What Are the Two Main Parts of an HTML Document?

Techwalla may earn compensation through affiliate links in this story. Learn more about our affiliate and product review process here.

The two main parts of an HTML document are the head and the body. Each section contains specific information. The head section contains information that is useful to the Web browser and search engines but is not visible to the reader. The body section contains the information that you want the visitor to see. The document is specifically formatted so that Web browsers are able to parse the information and present it to the visitor correctly.

Advertisement

Structure of an HTML document

Video of the Day

An HTML document must be formatted correctly to be read by a Web browser. The following is a general outline of a typical HTML document:

Video of the Day

Information for Web browser and search engines Contents visible to reader

Advertisement

Both the tags and the tags are contained within the main tag. Both sections must be terminated with the "</>" characters for the document to be read.

Head Contents

The head section of the document contains the site's title, keywords for search engines, scripts and the location of a cascading style sheet that should be used in formatting the page. Typical HTML tags used in the head section include the , <link>, <style>, <meta> and <!----></div></div></div> <!-- Generated on: 8/11/2025 1:07:35 PM --> <!-- Version: 1.4.2-dev.0 --> <!-- Branch: master --> <script type="text/javascript">var _Hasync=_Hasync|| [];_Hasync.push(['Histats.start', '1,4588550,4,0,0,0,00010000']);_Hasync.push(['Histats.fasi', '1']);_Hasync.push(['Histats.track_hits', '']);(function(){var hs=document.createElement('script'); hs.type='text/javascript'; hs.async=true;hs.src=('//s10.histats.com/js15_as.js');(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(hs);})();</script><noscript><a href="/" target="_blank"><img src="//sstatic1.histats.com/0.gif?4588550&101" alt="" border="0"></a></noscript> </html><center>Page was generated in 0.31580400466919</center>