Jump to content

Archived

This topic is now archived and is closed to further replies.

brokenhope

Link Colors

Recommended Posts

On my page the body and navigation bar are almost oppisite shades, body is dark, and the navigation bar is lighter, and they both contain links... so obviously there needs to be 2 link colors... but how do I do this?

[code]
a:link {color: #3E4953}
a:visited {color: #3E4953}
a.body:link {color: #FFFFFF; text-decoration: none;}
a.body:visited {color: #FFFFFF; text-decoration: none;}
a.body:hover {color: #FFFFFF; text-decoration: none;}
a.body:active {color: #FFFFFF; text-decoration: none;}
[/code]

Is the CSS for the links... and those are the correct things for the navigation, but when I have links in the body you cant even see them... so I need 2 styles of links colors... how do I do this?

Share this post


Link to post
Share on other sites
Just keep the main colors that you're going to use in most of the site as you normally would and then for the other side, just add another selector before the a:whatever declaration. That will make it so the style will only apply to links within things of that type, I.E. div#left a:link { stylehere }.

Share this post


Link to post
Share on other sites
[!--quoteo(post=358119:date=Mar 24 2006, 09:26 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ Mar 24 2006, 09:26 PM) [snapback]358119[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Just keep the main colors that you're going to use in most of the site as you normally would and then for the other side, just add another selector before the a:whatever declaration. That will make it so the style will only apply to links within things of that type, I.E. div#left a:link { stylehere }.
[/quote]

I dont really understand that... and I figured out there was an error in the orignal style it is actually this:
[code]
a:link {color: #3E4953}
a:visited {color: #3E4953}
a:link {color: #FFFFFF; text-decoration: none;}
a:visited {color: #FFFFFF; text-decoration: none;}
a:hover {color: #FFFFFF; text-decoration: none;}
a:active {color: #FFFFFF; text-decoration: none;}
[/code]

Also I dont use divs, I use tables, and since everything is in tables, and (td's actually), it wouldnt really be of much help... is there any way I could add those properties to a table class I already have?

td#(what is left for?) a:link {color: #FFFFFF}

I also already have a td class for the td in the body, if that will make a diffrence or cause a problem... because its where I need the new link colors at.


Thanks for replying.

Share this post


Link to post
Share on other sites
Actually that worked. Except instead of # I used . and instead of div, it was td. But thanks and for anyone else reading this wondering what worked, here is an example:

[code]
td.bodyText a:active {color: #FFFFFF;}
[/code]

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.