HTML <body> Tag

HTMLWeb DevelopmentFront End Technology

The <body> tag in HTML is used to set the body of the web page that contains all the contents like images, videos text, etc.

Following are the attributes −

Note: All the attributes of the body tag like alink, background, bgcolor, text, etc., deprecated in HTML5 −

Attribute
Value
Description
alink
rgb(x,x,x)
#xxxxxx
colorname
Deprecated − Specifies the color of the active links in the document.
background
URL
Deprecated − Specifies the background image file path.
bgcolor
rgb(x,x,x)
#xxxxxx
colorname
Deprecated − Specifies the background color.
link
rgb(x,x,x)
#xxxxxx
colorname
Deprecated − Specifies the color of all the links in the document.
text
rgb(x,x,x)
#xxxxxx
colorname
Deprecated − Specifies the color of the text in the document.
vlink
rgb(x,x,x)
#xxxxxx
colorname
Deprecated − Specifies the color of the visited links in the document.

 

Let us now see an example to implement the <body> tag in HTML -

Example

 Live Demo

<!DOCTYPE html>
<html>
<head>
<title>Document Title comes here</title>
</head>
<body>
   <h1>Heading comes here</h1>
   Content comes here
</body>
</html>

Output

raja
Published on 19-Jun-2019 15:34:49
Advertisements