View video tutorial

HTML <body> Tag

HTML

The <body> defines the documents body.

Document body


Displayable area in the document is defined by <body> tag.

Only one <body> tag can be in a document.

The <body> tag is a container of all viewable elements.

Global attributes

Global attributes may be applied on all elements, although some elements may have no effect on them.

<accesskey>, <class>, <contenteditable>, <contextmenu>, <data-*>, <dir>, <draggable>, <dropzone>, <hidden>, <id>, <lang>, <spellcheck>, <style>, <tabindex>, <title>, <translate>.

Learning with HTML Editor "Try it Now"

You can edit the HTML code and view the result using online editor.

Example

<body style="background-color:#fee5e5;">
    <h2>HTML body tag Example</h2>
    <h1>Body is a container.</h1>
    <p>The body contains everything display on the screen.</p>
</body>
Try it Now »

Click on the "Try it Now" button to see how it works.