Structure of HTML

The structure of an HTML document is divided into two main parts: the head and the body.

    • The head contains information about the document, such as the title, the author, and the keywords. It also contains the meta tags, which provide additional information to the browser and search engines.
    • The body contains the content that will be displayed on the web page. This includes text, images, links, and other elements.

The basic structure of an HTML document is as follows:

<!DOCTYPE html>
<html>
<head>
  <title>My First HTML Page</title>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
  <h1>This is my first HTML page</h1>
  <p>This is a paragraph of text.</p>
  <img src="image.png" alt="My image">
</body>
</html>

The <html> tag is the root element of an HTML document. It contains all the other elements in the document.

The <head> tag contains the metadata for the document. This information is not displayed on the web page, but it is used by the browser and search engines.

The <title> tag contains the title of the web page. This title is displayed in the browser’s title bar and in search engine results.

The <meta> tags provide additional information about the document. For example, the <meta charset> tag specifies the character encoding of the document, and the <meta name="viewport" tag specifies the width of the document in the browser.

The <body> tag contains the content that will be displayed on the web page. This content can include text, images, links, and other elements.

The <h1> tag is a heading element. It is used to create a large heading on the web page.

The <p> tag is a paragraph element. It is used to create a paragraph of text on the web page.

The <img> tag is an image element. It is used to insert an image on the web page.

This is just a basic overview of the structure of an HTML document. There are many other elements that can be used to create more complex and interactive web pages.

 

Leave a Reply

Your email address will not be published. Required fields are marked *