[css-d] classes and id's
Hi - I realize this is a very basic question, but the more I try to figure it out the more confused I get. So maybe one of you can set me straight! When using classes (or id's) - what is the correct way to do the following: a.leftborder {color: #ff;} OR .leftborder a {color: #ff;} OR what about a.leftborder:hover {color: #00;} OR .leftborder a:hover {color: #00;} And what about this ul.leftborder li a {color: #ff;} (Now that's getting really weird looking??? Is that how you do it?) I'm sorry to bother you all with something so basic, but I couldn't seem to find any thing consistent. And now I think I'm super confused! Very sincerely, Allison __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] classes and id's
It depends on what you are trying to do... Each of these does something slightly different: a.leftborder {color: #ff;} /* all anchors having the leftborder class will be white e.g. a href=foo.html class=leftborderbar/a */ .leftborder a {color: #ff;} /* all anchors inside an element having the leftborder class will be white e.g. div class=leftbordera href=foo.htmlbar/a/div */ a.leftborder:hover {color: #00;} /* all anchors having the leftborder class will be black when moused over e.g. a href=foo.html class=leftborderbar/a */ .leftborder a:hover {color: #00;} /* all anchors inside an element having the leftborder class will be black when moused over e.g. div class=leftbordera href=foo.htmlbar/a/div */ ul.leftborder li a {color: #ff;} /* all anchors inside an li inside a ul having the leftborder class will be white e.g. ul class=leftborderlia href=foo.htmlbar/a/li/ul */ If all of this went over your head, have a look at http://css.maxdesign.com.au/selectutorial/ for a great primer on selectors and CSS. Jon __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] classes and id's
Jon Jensen wrote: It depends on what you are trying to do... Each of these does something slightly different: [...] ul [...] If all of this went over your head, have a look at http://css.maxdesign.com.au/selectutorial/ for a great primer on selectors and CSS. Jon And a direct online explication for what a home made selector is expected to do: the SelectORacle: http://penguin.theopalgroup.com/cgi-bin/css3explainer/selectoracle.py Greetings, francky __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7b2 testing hub -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/