HTML <body> tag
- closing tag
- required
- void element
- no
- lives inside
- <html>, after <head>
- typically holds
- everything visible on the page
Where it goes
The second thing inside <html>, right after </head>.
Example
<body>
<h1>Hello</h1>
<p>Welcome to my page.</p>
</body>Open this example in the editor →
Common mistakes
- Putting <head>-only tags like <title> or <meta> inside <body>. They belong only in <head>.
- Leaving text or tags after </body>. Anything after the closing tag is outside the page. The browser moves it somewhere, usually not where you meant.
- Styling the page with old attributes on <body> like bgcolor. Those are long dead. Give <body> a rule in CSS like any other tag.