Pr.Pg Next Pg

LINK, ALINK, VLINK tag tutorials

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

  • By default hyperlink is displayed with underline and is in blue color. Many times web designer wish to set different colors for hyperlink, as you could see on the left of our screen all topic link is shown in White color.

  • It wouldn’t be visible over blue background, if it uses its default blue color.

  • The below chart explain this attribute in detail.

 

Sr No

Attributes

Full Form

Default Color

Color Hex Value

Color

1

LINK

Stands for Hyperlink

BLUE

#0000FF

blue

2

ALINK

Stands for Active Hyperlink

RED

#FF0000

red

3

VLINK

Stands for Visited Hyperlink

PURPLE

#400040

purple

 

Syntax:

<body link = “Hexadecimal code or color name” alink = “Hexadecimal code or color name”

vlink = “Hexadecimal code or color name”>

Actual document text and other information

</body>

 

Example: HTML program to examine default link color
Output:

Note: In this HTML program we have not declared the link attribute but still browser is displaying link color as blue because it’s a default color. Now in next example let’s change the link color to aqua.

Example: HTML program to set link color
Output:
Example: HTML program to set the visited link color
Output:

 

Note: In the above program oracle link is in blue color because it is not yet visited and remaining links shows in green color because it is visited link.

Example: HTML program to set the active link color
Output:

 

Note: In above program lime color shows the active link and the link will be active at the time of clicking the link.

Pr.Pg border                                              Next Pg