Pr.Pg Next Pg

<BODY> ……………..</BODY> tag tutorials

  • This is a paired tag element. It requires opening and closing tag. The entire content of the document should be placed within BODY tag.

  • It contains all the text, images, hyperlinks, tables, color settings, image map, functions, script, special effects and most of elements. All the information must be typed with in <BODY> ……………. </BODY>.

  • Let’s study following tables shows the attributes of <BODY> elements.

BGCOLOR = Hexadecimal code or Color name

 

Sr No

Attributes

Descriptions

1

BGCOLOR

This attribute of <BODY> specifies background color of web page.

2

BACKGROUND

This attributes of <BODY> specifies background image or texture. Image gets displayed as background behind the text in web documents.

3

TEXT

This attributes of <BODY> element change color of text.

4

LINK

These attributes of <BODY> elements, allows you to control over color of hyperlink.

5

ALINK

These attributes of <BODY> elements, allows you to control over color of hyperlink.

6

VLINK

These attributes of <BODY> elements, allows you to control over color of hyperlink.

 

BGCOLOR

  • This attribute of <BODY> specifies background color of web page.

  • One can specify color by name or by giving Hexadecimal code.

  • #rrggbb stands for Hexadecimal number of RED, GREEN and BLUE color.

 

Syntax:

<body bgcolor = Hexadecimal code or color name>

Actual Body Contains

</body>

 

Example: HTML program to set back ground color of web page
Output:
Example: HTML program to set back ground color of web page
Output:

 

background = url

  • This attributes of <BODY> specifies background image or texture. Image gets displayed as background behind the text in web documents.

  • In most of the cases images are files having extension of .GIF, .JPG or .JPEG and .PNG Here URL stands for name of the graphics file.

  • If the Graphic file is not in same directory then you must specify full path. Also note that if graphic file is smaller than screen view area, it will be tiled to cover the entire area.

 

Syntax:

<body background = url>

Actual text and other documents

</body>

 

Example: HTML program to set back ground image
Output:

 

text = Hexadecimal code or Color name

  • This attributes of <BODY> element change color of text. In the next example you will learn how to change default text color to Blue.

  • One can give text color by specifying Color name or by giving Hexadecimal value. So you can say COLOR = BLUE or COLOR = #0000FF.

 

Syntax:

<body text =Hexadecimal code or Color name>

Actual document text and other information

</body>

 

Example: HTML program to set a text color of a body
Output:
Example: HTML program to set a text color of body using hexadecimal color code
Output:
Pr.Pg border                                              Next Pg