How is the structure of an HTML document presented?
The structure of an HTML document includes a number of tags. Tags are pieces of text that are enclosed in angle braces. A tag functions as a container for content or other HTML tags. The text below demonstrates the format of an HTML document:
<!DOCTYPE html>
<html>
<head>
<title>Document</title>
</head>
<body>
<!-- content -->
</body>
</html>
Be not frightened. I’ll explain to you what is being depicted above.
NOTE: These are the five essential HTML tags.
<!DOCTYPE html>, <html>, <head>, <title>, <body>
The web browser uses the!DOCTYPE> declaration element to determine what version of HTML is being used in the content. The most recent version, HTML 5, is 5.
- <html>
The <html> tag is the root of an HTML page
- <head>
The <head> tag contains page metadata
- <title>Document</title>
The <title> tag contains the title of a page and is shown in the browser title bar
- </head>
The </head> tag is closing of <head> tag
- <body>
<body> tag is the main tag of HTML. It contains the main body of the page and is shown in the white part of the browser
- </body>
The </body> tag is closing of <body> tag.
- </html>
The </html> tag is closing of <html> tag.