In this section, we will learn what HTML <body> element is and how it works.
What is <body> Tag in HTML?
HTML <body> element represents the main body of an HTML document. Basically, this is where we design and put the structure and content of a webpage. So it’s a container for the body of a webpage.
HTML <body> Tag Syntax:
<body> webpage content </body>
HTML <body> Tag Values
The content, like images, articles, comments, and their structures, are part of the values that we usually put within the body of the <body> element.
Example: using <body> tag in HTML
Example: body background color in HTML
To change the background color of the <body> element, we can use the CSS background-color property (as we did in the previous example).
Example: body background image in HTML
We can also use the CSS background-image to set an image as the background of the <body> element.