Basic HTML syntax and structure.


Basic HTML syntax and structure

HTML elements are the building blocks of an HTML document and represent the content and structure of a web page. Each HTML element is defined using an opening and closing tag, with the content of the element appearing between the tags.

The basic HTML document structure includes the following elements:

  • <!DOCTYPE html>: declares the document type and version of HTML being used.
  • <html>: the root element that contains all other HTML elements.
  • <head>: contains information about the document, such as the title of the page, which is displayed in the browser's tab, and metadata.
  • <body>: contains the main content of the web page.

Headings in HTML are defined using the <h1> to <h6> elements, with <h1> being the largest heading and <h6> being the smallest. Paragraphs are defined using the <p> element, while lists can be ordered using the <ol> element or unordered using the <ul> element, with each list item defined using the <li> element.

Links in HTML are created using the <a> element, with the href attribute specifying the URL to which the link should point.

 For example: 

<a href="https://www.example.com">Visit Example.com</a>

Here is an example of a basic HTML document structure:

<!DOCTYPE html> <html> <head> <title>My First HTML Page</title> </head> <body> <h1>Welcome to my website</h1> <p>This is a sample paragraph.</p> <ul> <li>Item 1</li> <li>Item 2</li> </ul> <a href="https://www.example.com">Visit Example.com</a> </body> </html>


Post a Comment

Let us Know...!

Previous Post Next Post