HTML Body Tag

The <body> tag is one of the most essential tags in any HTML document. It represents the main content area of the web page — the part that you actually see and interact with in the browser.

Everything inside the <body> tag is what the user sees. Everything outside it (like the <head> tag) is for browser use, settings, or metadata.

Where is the <body> Tag Used?

The <body> tag is placed inside the <html> tag, right after the <head> section.

<!DOCTYPE html>
<html>
  <head>
    <title>My Webpage</title>
  </head>
  <body>
    <!-- All visible content goes here -->
  </body>
</html>
Syntax -
<body attributes>.. text/tags here.. </body>
AttributeDescriptionValues
AlinkSets color of active (clicked) linksColor
BackgroundSpecifies the background imageURL
BgcolorSets background colorColor
LinkSets color of normal linksColor
TextSets text colorColor
VlinkSets color of visited linksColor
Example -

Scenario - Example Using <body> Tag

<!DOCTYPE html>
<html>
	<head>
		<title> Body element example.. </title>
	</head>
	<body>
		<h1>Welcome to TutorialsCampus</h1>
		<p>This is a paragraph inside the body tag.</p>
		<a href="https://tutorialscampus.com">Visit Website Home</a>
	</body>
</html>
Output -

Welcome to TutorialsCampus

This is a paragraph inside the body tag.

Visit Website Home
Explaining Example -

What you see in the browser:

  • A heading that says “Welcome to TutorialsCampus”.
  • A paragraph with some text
  • A clickable link