Electric Type

Multimedia

About Us

News

Help

The Visited Link Color Bonanza

Page 2 — Making It Work

Here's the full code for making multiple visited link colors work (remember that this goes in the <HEAD> of the HTML):

<STYLE TYPE="text/css">
<!--
A.nav:link { color: #FFFFFF }
A.nav:visited { color: #CCCCCC }
//-->
</STYLE>

<SCRIPT LANGUAGE="JavaScript">
<!--
if (parseInt(navigator.appVersion) < 4 && navigator.appName == "Microsoft Internet Explorer") {
document.write ("<STYLE> .nav { color: #FFFFFF } </STYLE>"); }
//-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
<!--
if (parseInt(navigator.appVersion) < 4 || (navigator.appName != "Netscape" && navigator.appName != "Microsoft Internet Explorer")) {
vlink = "<FONT COLOR=#FFFFFF>"; }
else
vlink = "";
//-->
</SCRIPT>

Then add this to the <BODY> of the page:

<A HREF="unvisited.html" CLASS="nav"><FONT FACE="Verdana" SIZE="2"><SCRIPT LANGUAGE="JavaScript">
<!--
document.write(vlink);
//-->
</SCRIPT>
<NOSCRIPT>
<FONT COLOR="#FFFFFF">
</NOSCRIPT>
unvisited link
</FONT></A>

<A HREF="01.html" CLASS="nav"><FONT FACE="Verdana" SIZE="2"><SCRIPT LANGUAGE="JavaScript">
<!--
document.write(vlink);
//-->
</SCRIPT>
<NOSCRIPT>
<FONT COLOR="#FFFFFF">
</NOSCRIPT>
visited link
</FONT></A>

See the code in action.

Keep in mind that, because this solution uses CSS, only 4.0+ browsers will support it. Other browsers should see white links.

next page»


Dynamic HTML  

Frames  

HTML Basics  

Stylesheets  

Tables  

XML  

Javascript  

Database Connections  

Intro To Perl  

HTML 4.0  

User Blogs

Screen Shots

Latest Updates

Contact Us

Valid HTML 4.01!
Valid CSS!

Breadcrumb

© ElectricType
Maintained by My-Hosts.com
Site map | Copyright | Disclaimer
Privacy policy | Acceptable Use Policy
Legal information.