brokenhope Posted March 24, 2006 Share Posted March 24, 2006 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? Quote Link to comment https://forums.phpfreaks.com/topic/5721-link-colors/ Share on other sites More sharing options...
moberemk Posted March 25, 2006 Share Posted March 25, 2006 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 Link to comment https://forums.phpfreaks.com/topic/5721-link-colors/#findComment-20451 Share on other sites More sharing options...
brokenhope Posted March 25, 2006 Author Share Posted March 25, 2006 [!--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. Quote Link to comment https://forums.phpfreaks.com/topic/5721-link-colors/#findComment-20456 Share on other sites More sharing options...
brokenhope Posted March 25, 2006 Author Share Posted March 25, 2006 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] Quote Link to comment https://forums.phpfreaks.com/topic/5721-link-colors/#findComment-20466 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.