<body>

Document

Contains all the visible content of the HTML document. Everything the user sees and interacts with is placed inside the body element.

Common Attributes

onloadonunload

Example

<body>
  <h1>Hello World</h1>
  <p>Page content here.</p>
</body>

About the <body> Element

The <body> HTML element belongs to the Document category of HTML elements. Contains all the visible content of the HTML document. Everything the user sees and interacts with is placed inside the body element. Understanding when and how to use this element is essential for building well-structured, accessible, and SEO-friendly web pages.

The <body> element requires both an opening <body> and closing </body> tag. Content placed between these tags becomes the element's children. This element is part of the current HTML Living Standard and is supported in all modern browsers including Chrome, Firefox, Safari, and Edge.

Proper use of semantic HTML elements like <body> improves document structure, helps screen readers interpret content correctly, and provides signals to search engines about the purpose of different sections of your page. This leads to better accessibility scores, improved SEO rankings, and more maintainable code.

Related Elements