Wiki NewForum | Latest Entertainment News

Wiki NewForum | Latest Entertainment News (https://www.wikinewforum.com//index.php)
-   HTML Forum & Tutorial (https://www.wikinewforum.com//forumdisplay.php?f=98)
-   -   How to create text links in multiple colors (https://www.wikinewforum.com//showthread.php?t=25313)

bholas 08-09-2010 12:18 PM

How to create text links in multiple colors
 
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="yellow" vlink="yellow">

<a href="/tips/">
This link will be yellow.
</a>

</body>
Listing #1 : HTML code. Download bodyclr.html (0.21 KB).


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="/tips/internet/">
Internet
</a>
</font>

<br>

<font color="green">
<a href="/tips/windows/">
Windows
</a>
</font>

<br>

<font color="blue">
<a href="/tips/programming/">
Programming
</a>
</font>
Listing #2 : HTML code. Download linkclr1.html (0.25 KB).


Result: Internet
Windows
Programming
Now let's try taking above tags and moving FONT tags inside A tags (anchor or link) as follows:
<a href="/tips/internet/">
<font color="red">
Internet
</font>
</a>

<br>

<a href="/tips/windows/">
<font color="green">
Windows
</font>
</a>

<br>

<a href="/tips/programming/">
<font color="blue">
Programming
</font>
</a>
Listing #3 : HTML code. Download linkclr2.html (0.25 KB).


Result: Internet
Windows
Programming


All times are GMT. The time now is 08:34 PM.

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2024, vBulletin Solutions, Inc.