Till Now you have learned some basic HTML tags, therefore, now it is important for you to understand the basic structure of an HTML document.
An HTML document has two main parts:
The head element contains information about the current document, such as its title, keywords, description that may be useful to search engines, and other data that is not considered document content. User agents do not generally render elements that appear in the HEAD as content. They may, however, make information in the HEAD available to users through other mechanisms.
The body of a document contains the document's content. This element contains the visible page content. You can think of the body as a canvas where the content appears: text, images, colors, graphics, etc.
And both parts are enclosed in
<html> tag (also known as root tag).
But firstly every HTML document must start by declaring that it is an HTML document using
<!DOCTYPE html> tag.
( Document declaration tag )
<html> ( Root tag )
( Document header related tags )
( Document body related tags )
|<!DOCTYPE html>||This tag defines the document type and HTML version.|
|<html>||This tag encloses the complete HTML document.|
|<head>||This tag represents the document's header which can keep other HTML tags like <title>, <meta>, <link> etc.|
|<body>||This tag represents the document's body which keeps other HTML tags like <h1>, <p>, <img> etc. This element contains the visible page content.|
All HTML5 documents must start with a <!DOCTYPE html>