[css-d] Two different sets of hyperlink rules
I have a site where some of the hyperlinks are on a white background and some are on a blue one, so I want to have two different sets of rules for the hyperlinks. At the moment I have (below) for the main set: a { text-decoration:underline; background-color:#FF; color:#0303ce; } I then have this (below) for the area with the blue background: .addressbar { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold; color:#FF; } And this is what I have (below) for the hyperlinks in the address bar, but it's not working. I've just taken a wild guess and it didn't work. Can anyone help me? a.addressbar { text-decoration:underline; background-color:#0303ce; color:#FF; } Joanne __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Two different sets of hyperlink rules
On 7/24/2005 7:42 PM Joanne wrote: I have a site where some of the hyperlinks are on a white background and some are on a blue one, so I want to have two different sets of rules for the hyperlinks. At the moment I have (below) for the main set: a { text-decoration:underline; background-color:#FF; color:#0303ce; } I then have this (below) for the area with the blue background: .addressbar { font-family:Verdana, Arial, Helvetica, sans-serif; font-size:11px; font-weight:bold; color:#FF; } And this is what I have (below) for the hyperlinks in the address bar, but it's not working. I've just taken a wild guess and it didn't work. Can anyone help me? a.addressbar { text-decoration:underline; background-color:#0303ce; color:#FF; } It looks like you're running into specificity problems. "a.addressbar" refers to "a" elements of class "addressbar (). Try something like this: .addressbar a{ background-color:#0303ce; color:#FF; } This selects "a" elements that are descendants of an element with the class "addressbar"--so selects the a in this snippet: Link . Then add other rules if you want to control hover and visited states, for instance: .addressbar a:link{ text-decoration:underline; } .addressbar a:visited{ text-decoration:underline; } .addressbar a:hover{ text-decoration:none; } .addressbar a:active{ text-decoration:underline; } -- Steve Clason Web Design and Development Boulder, Colorado, USA www.topdogstrategy.com (303)818-8590 __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] Two different sets of hyperlink rules
Joanne wrote: And this is what I have (below) for the hyperlinks in the address bar, but it's not working. I've just taken a wild guess and it didn't work. Can anyone help me? a.addressbar { text-decoration:underline; background-color:#0303ce; color:#FF; } Joanne, Steve already explained how you need to change your selectors to properly target the links inside addressbar. But here are a few links that will help you understand what selectors mean: http://css.maxdesign.com.au/selectutorial/ http://gallery.theopalgroup.com/selectoracle/ Zoe -- Zoe M. Gillenwater Design Specialist UNC Highway Safety Research Center http://www.hsrc.unc.edu __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/