Body Tag - Part 1 - (bgcolor, background, link, vlink, alink, text)

 



BODY TAG - PART 1


We know that the main part of an html document is the body.

Now we will discuss the body section in detail.

First of all it is good for us to know that everything we are going to discuss in this body section must be in Body Opening tag i.e. <body> and Body Closing tag i.e. </body>.

Usually a web page is made beautiful by using six attributes with a body tag.

The six attributes is:

1. bgcolor

We have 3 methods to give background color.

First: the name of the color directly when giving the background color.

Example:

 <html>
<head>
<title> </title>
</head>

<body bgcolor="red">

</body>
</html>

 




Second: with RGB format when giving background color. RGB i.e. RED, GREEN, BLUE Color combines these colors to create other colors

Example:

<html>
<head>
<title> </title>
</head>

<body bgcolor="rgb (70,255,90)">

</body>
</html>




Third: use 8-digit code to give background color.

RRGGBB has 2 digits for each color. RR = RED, GG = GREEN, BB = BLUE.

Code writing rule is - #RRGGBB

It is made up of decimal and hexadecimal numbers. The decimal number is from 0 to 9 and the hexadecimal number is from 0 to 9 and from A to F.

Example:

<html>
<head>
<title> </title>
</head>

<body bgcolor="#ffb3b3">

</body>
</html>

 




2. background

This attribute can be used to give background images on web pages.

<html>
<head>
<title> </title>
<head>
<body background=”file name.iamge-format”>
</body>
</html>

 <html>
<head>
<title> </title>
</head>

<body background="lion.jpg">

</body>
</html>

 


Here "lion" is the file name and  ".jpg" is the image format.


The folder in which the HTML document is saved must have the image in it.


3. link

This attribute determines the color of all hypertext links on the web page.

<html>
<head>
<title> </title>
</head>

<body link="green">

First Link = <a href="https://google.com"> Google </a>  

Second Link = <a href="https://facebook.com"> Facebook </a>

</body>
</html>

 



4. vlink

This attribute determines the color of all the hypertext links visited on the web page.

<html>
<head>
<title> </title>
</head>

<body link="green" vlink="red">

First Link = <a href="https://google.com"> Google </a>   

Second Link = <a href="https://facebook.com"> Facebook </a>

</body>
</html>

 



5. alink

This feature determines the color of the link that is currently being clicked on.

<html>
<head>
<title> </title>
</head>

<body link="green" vlink="red" alink="yellow">

First Link = <a href="https://google.com"> Google </a>   

Second Link = <a href="https://facebook.com"> Facebook </a>

</body>
</html>

 



6. Text

This attribute can be used to color all the text on the web page.

 <html>
<head>
<title> </title>
</head>

<body text="olive">

This is a Website

</body>
</html>

 

Previous
Next Post »
0 Komentar