Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CSS 2 Link Colors

Status
Not open for further replies.

metaphiz

Programmer
Jun 30, 2004
91
US
I'm using the CSS code below to manage link colors. How do I set up 2 different sets of link colors? Please show CSS code and code to implement on HTML page. Thanks!

A:Link { color: #FFFFFF; font-size: 11px; text-decoration: none }

A:Visited { color: #FFFFFF; font-size: 11px; text-decoration: none}

A:Active { color: #FFFFFF; font-size: 11px; text-decoration: none }

A:Hover { color: #FFFFFF; font-size: 11px; text-decoration: none }
 
Depends. You could go with classes or dependancy. I usually prefer the latter method:
With class:
Code:
a { color: #FFFFFF; font-size: 11px; text-decoration: none; }
a.special { color: red; font-size: 15px; text-decoration: none; }
Through dependancy:
Code:
#menu a { color: #FFFFFF; font-size: 11px; text-decoration: none; }
#contents a { color: red; font-size: 15px; text-decoration: none; }
Now, links within an element with an id #menu will look different to those in an element with an id #contents. Like so:
Code:
<div id="menu"><a href="#">About</a></div>
<div id="contents"><a href="#">About</a></div>
Incidentally, since you were not altering states in your code, I omitted that.
 
No, actually I was just disgusted from a designer point of view that they were capitalized. I am a strong believer of lower-case. Ok, ok, I was lazy. There was lots on lots of typing nonetheless.
 
They visually take up more space and as such make files bigger. Aren't we striving for smaller files and bigger paychecks?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top