What is a body element?
The body element is the most important thing on an html document, because it acts as the main container that holds all the content you usually see on a website or browser like images, buttons, videos, forms, text and links when you visit any website on the internet. Without it web pages would exist only as code and will not be able to display meaningful content to visitors or users.
How to create a body element?
We use this element <body> </body> to create the body for our html document. Paragraphs, images, hyperlinks, buttons, videos, forms, and other elements, must be placed between the body element, because this structure helps web browsers and search engines understand what your website is about and the layout of your html document. And it supports all global attributes such as class, style, id, onload and onclick. This attributes allows developers to apply javascipt functionality and css styling on a web page.
Example body element code
Let's write some paragraph content or text between the body element
<body>
<p>
This is a paragraph element inside a body element.
</p>
</body>
Another example body element code
Another example, let's write the same paragraph content or text but this time we add an h1 heading element with some text.
<body>
<h1>
This is a heading element inside a body element.
</h1>
<p>
This is a paragraph element inside a body element.
</p>
</body>
Html quiz
What is the correct syntax for a body element?