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.

Example

<body>
<p> Body contains Navigation bar, Side bar, content and other elements.</p>
<nav> It contains the navigation bar. </nav>
<main>
 <h1>Browesers</h1>
 <p>Here the content related to main topic of the page is written.</p>
 <section>
  <h2>Mostly used browsers</h2>
  <article>
  <h3>Google</h3>
  <p>Here the content is related to the google browser.</p>
  <h3>Firefox</h3>
  <p>It contains the information related to the firefox.</p>
  <h3>Safari</h3>
  <p>This paragraph contains the infromation that is relevant to the safari topic.</p>
  </article>
 </section>
 
 <footer>
 <p>This block of content contains the copyright or contace information.</p>
 </footer>
</main>
</body>
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?

 

Email:

Message:

Get the newsletter