HTML body tag

Html <body> element contains all the elements that represent the visualized structure of the website. It contains elements like div, nav and aside etc. The following example explains the basic structure of the website that we make in the body element.


<p> Body contains Navigation bar, Side bar, content and other elements.</p>
<nav> It contains the navigation bar. </nav>
 <p>Here the content related to main topic of the page is written.</p>
  <h2>Mostly used browsers</h2>
  <p>Here the content is related to the google browser.</p>
  <p>It contains the information related to the firefox.</p>
  <p>This paragraph contains the infromation that is relevant to the safari topic.</p>
 <p>This block of content contains the copyright or contace information.</p>
Try </>

Related tags

There are many elements in the body element. Basic elements have been given below.

p, h1-h6, a, audio, video, nav, aside, main, article, img, iframe.

Tag omission

End tag (</body>) may be omitted.

Global Attributes

All the global attributes are applicable on the body element.

Was this article helpful?




Get the newsletter