|
Would you like to use multiple
colors for your text links, rather than using a single link color
for the whole page?
You can specify the color
of links for the whole page using LINK and VLINK attributes inside
the starting BODY tag as follows:
<body link="purple" vlink="purple">
<a href="../index.htm">
This link will be purple.
</a>
</body>
|
This link will be purple.
But, how can you have one
link colored in red, another in green and so forth? You may notice
how the following method does not work:
<font color="red">
<a href="../index.htm">
Introduction
</a>
</font>
<br>
<font color="green">
<a href="../starter.htm">
Starter Site
</a>
</font>
<br>
<font color="blue">
<a href="../help.htm">
Help Files </a>
</font>
|
Result:
Introduction
Starter-Site
Help Files
Now let's try
taking above tags and moving FONT tags inside A tags (anchor or link)
as follows:
<a href="../index.htm">
<font color="red">
Introduction
</font>
</a>
<br>
<a href="../starter.htm">
<font color="green">
Starter Site</font>
</a>
<br>
<a href="../help.htm">
<font color="blue">
Help Files</font>
</a>
|
Result:
Introduction
Starter Site
Help Files
NOTE:
Very early browser implementations of the COLOR attribute in FONT
tags don't recognize color names. In our examples here to make it
easy to follow we have used color names but in your programming
be sure to use numeric color codes whenever possible to make your
pages backward compatible with older browsers.
|