HTML Document is a file or a page containing HTML. HTML is a markup language which consists of Tags. HTML Tags are used to display the content on the browser.
Table of Contents
Structure of HTML Document
The structure of HTML Document is very simple and is actually quite similar to the structure of Human Body. Like human body it has a Head and then after head, there is a Body section.
The head section and the body section are two main components of HTML Document. These two sections of HTML Document are enclosed inside the main HTML Tag followed by doctype declaration.
The basic structure of HTML Document is written below.
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
</head>
<body>
</body>
</html>
This is how the simple HTML Document looks like.
DOCTYPE Declaration
The Doctype declaration is not an HTML Tag, It is used to tell the Browser about the version of HTML written on the web page.
The Doctype tag is the first tag in HTML document you should write just before Html starting tag.
HTML Tag
After the doctype declaration there is a main HTML Tag. This html tag contains the two main section of HTML Document, the head section and the body section.
HTML Tag is used to define the root of HTML Document.
Head Tag
Head tag is like the human head. It contains the most important information about the HTML Document. Anything that is inside this head tag won't be rendered and won't be visible on browser.
HTML Head Tag contains the meta information about the web page. HTML head tag consists of tags like title tag, meta tags, link tags and more.
Body Tag
Body Tag is used to define the HTML Document Body. The body tag contains all the content of the HTML document.
The content can be in any form, text, image, audio or video. Whatever you write inside the two opening and closing body tags, it will be displayed on the browser screen.