HTML body tag

The part of the HTML document that is displayed on the browser is within the body tag. So, body tag defines the body of the HTML document. Any html object such as texts, pictures, lists, tables, links etc. can be inserted here.

We can use multiple tags within the body tag. However, some tags cannot be used within body. This is because these tags need to be defined within the head tag. These tags are title, link, and meta.

We can define <script> tag within head or body if we want to write JavaScript within html. Script tag can be inserted to the bottom of the html body tag.

Tags that cannot be used within body

  • link tag
  • meta tags
  • title tag

body tag

<html>
  <head>
     <title></title>
  </head>

  <body>
   CONTENT
  </body>

</html>

script tag inside the body tag

<html>
  <head>
     <title></title>
  </head>

  <body>
    <p>HTML body tag</p>
      
    <script>
       console.log("Hello World");
    </script>
  </body>

</html>
371 Views
48350cookie-checkHTML body tag

Leave a Reply

Your email address will not be published. Required fields are marked *