HTML 5 Document Structure

Share:

HTML 5 Document Structure


The HTML 5 Document Structure How to Establish an HTML 5 Document Structure The HTML 5 Head Element The HTML 5 Body Element HTML 5 Headings and Paragraphs The Document Structure: At the end of the last chapter, we discussed how to create and save a simple HTML 5 document; however, we did not discuss much about the document structure. An HTML 5 document mainly consists of a Head and Body. The Head contains the data, which informs the browser

and even web servers that it is an HTML 5 document. On the other hand, the Body contains content that web browsers actually display. This chapter covers all the major elements necessary to craft a basic HTML 5 document.

Establishing a Document Structure:


Each and every HTML 5 document employs a unique combination of elements and content to define a page. The structure of all the properly documented pages is the same and contains: A declaration at the top, which indicates that it is an HTML 5 document A document header A document body A collection of HTML 5 elements constitutes an HTML 5 document. Some of these elements are essential while others are optional. However, you can always find the following three elements in every page in addition to the DOC Type declaration at the top.

<! DOCTYPE > informs the browsers that it is actually an HTML 5 document. Although there are other types of DOC Types, this is the most commonly used declaration.

The DOC Type Declaration is followed by < html > </ html > opening and closing tags.

These tags contain everything inside the document, including the Head and Body. < head > </ head > opening and closing tags follow the opening html tag.

These tags contain information about the body, title of the page, definitions, labels, etc. You can only use certain markup elements in the HTML 5 head. Some of these elements include style, title, base, link, script and meta. In HTML 5, these elements are collectively known as HTML Head Elements.

After the closing head tag is the < body > </ body > opening and closing Body tags They contain all the content which appears on the browser, as well as the related HTML 5 codes. Theoretically, you can create an HTML 5 document without anything in the body, but you need to have a well-crafted Head and Body to index your page properly in the browser. The following example contains all the basic elements you need to create an HTML 5 page.

 

 

No comments