[thelist] font color on links

Max Schwanekamp lists at neptunewebworks.com
Tue May 23 12:52:46 CDT 2006


> From: Dallas Cahker
> <style>
> .topnav{font: bolder 11px Verdana; padding-top: 
> 25px;text-decoration: none}
> .topnav.A:link{color: #4D4D4D;text-decoration: none}
> .topnav.A:visited{color: #4D4D4D;text-decoration: none}
> .topnav.A:active{color: #194C88;text-decoration: none}
> .topnav.A:hover{color: #194C88;text-decoration: none}
> </style>
> 
> <td align="center" class="topnav"><a href="index.html"
> class="topnav">HOME</a>
> 
> so when its on index.html or hovered I want the HOME link to 
> be blue #194C88
> and the rest of the time grey #4d4d4d.  What am I doing wrong?

The CSS should be:
<style>
.topnav { ... }
.topnav a { color: #4d4d4d; text-decoration: none; }
.topnav a:hover, 
.topnav a:visited { color: #194c88; }
</style>
Note the space between .topnav and a.  No need to repeat yourself with each
pseudoclass.  Use the cascade to your benefit.
-- 
Max Schwanekamp
http://www.neptunewebworks.com/





More information about the thelist mailing list