Basic Structure

HTML <body> Tag

The <body> tag defines the document's body.

Definition and Usage

The <body> tag defines the document's body.

Standard Syntax:<body>...</body>

Interactive ExampleRunnable

HTML <body> Example

html
Try it Yourself
Live code demonstration for the <body> tag. Click "Try it Yourself" to edit and experiment in real time.
<html>

 <head>

  
 <title>Title of the document</title>

 </head>

<body>
  <h1>This is a heading</h1>
  
    <p>This is a paragraph.</p>
</body>

</html>

Attributes for <body>

0 Supported Attributes

The <body> tag does not have tag-specific attributes. It supports all standard Global Attributes.

Global Attributes

The <body> tag also supports the standard global attributes in HTML, including class, id, style, title, hidden, and data-*.

HTML Global Attributes Reference →
Event Attributes

The <body> tag supports event attributes in HTML, such as onclick, onmouseover, onfocus, and more.

HTML Event Attributes Reference →

Browser Compatibility

ChromeEdgeFirefoxSafariOpera

More Tags in Basic Structure

View All 123Tags →