The Wayback Machine - https://web.archive.org/web/20240118164458/https://www.geeksforgeeks.org/how-to-define-the-documents-body-in-html5/
Open In App
Related Articles

How to define the document’s body in HTML5 ?

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

The document’s body in HTML5 is defined by the <body> tag which is placed with in the <html> tags and just after the <head> tag.
The body tag can include:

  • headings tags : <h1>, <h2>, <h3> and so on.
  • paragraph tag: <p>
  • line break tag: <br>
  • horizontal rule tag: <hr>
  • image and video tags: <img> <video>
  • list tags: <ul> and <ol>
  • table tag: <table>

The body tag contains so many other tags, all the vital information on the web-page, or someone can say that it is the skeleton on the web-page.

Example: Below example illustrates the use of body tag.

HTML




<!DOCTYPE html>
<html lang="en">
<head>
  <title>
    Geeks-For-Geeks
  </title>
</head>
<body>
  <!-- Paragraph Tag-->
  <p>Geeks-For-Geeks</p>
  
    
  <!--H1 Tag--> 
  <h1>Geeks-For-Geeks</h1>
    
  <!--H2 Tag-->
  <h2>Geeks-For-Geeks</h2>
    
  <!--H3 Tag-->
  <h3>Geeks-For-Geeks</h3>
    
  <!--H4 Tag-->
  <h4>Geeks-For-Geeks</h4>
    
  <!--Line Break Tag-->
  <br>
    
  <!--Horizontal Rule Tag-->
  <hr>
    
  <!--Image Tag-->
  <img src=
        
  <h2>Geeks-For-Geeks is Best Site For:</h2>
    
  <!--unordered list tag--->
  <ul>
    <li>DSA</li>
    <li>Web Development</li>
    <li>Gate</li>
    <li>and much more....</li>
  </ul>
</body>
    
</html>


Output: All the tags we have used inside our body tag is now visible on the web-page. The image gets down below shows the output of the above code and the use of each and every tag that we have used in our body tag.


Learn to code easily with our course Coding for Everyone. This course is accessible and designed for everyone, even if you're new to coding. Start today and join millions on a journey to improve your skills!

Whether you're preparing for your first job interview or aiming to upskill in this ever-evolving tech landscape, GeeksforGeeks Courses are your key to success. We provide top-quality content at affordable prices, all geared towards accelerating your growth in a time-bound manner. Join the millions we've already empowered, and we're here to do the same for you. Don't miss out - check it out now!

Commit to GfG's Three-90 Challenge! Purchase a course, complete 90% in 90 days, and save 90% cost click here to explore.
Last Updated : 12 Mar, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads
Complete Tutorials