|
|
Quick summary... if you have multiple elements inside the style declaration, that means nested elements.
So for instance
.sidebar a { whatever }
means "apply whatever style only to a tags that are inside things with class sidebar". Just
a { whatever }
means "apply whatever style to any a tags". There's an order of preference which states that the more specific a declaration is, the more it takes precedence, so something declared for .sidebar a will take precedence over something just for a. (You can dick with this order but that's something you don't want to bother with right now.)
There needs to be a space between the element names. If you put commas, that's a multiple declaration, e.g.
.sidebar, a { font-weight: bold; }
will make everything in the sidebar as well as any link anywhere bold.
.sidebar a { font-weight: bold; }
will just make links in the sidebar bold.
You can really go a long way with this if you use a lot of nested tags - for instance
ul li ul li a { color: #f00; }
will make only links inside unnumbered list elements that are inside *other* unnumbered list elements red. Pretty specific, but if you look at the standard stylesheets for Wordpress they use that sort of thing a lot.
If you've not got it already, get the Firefox web developer toolbar. It's got a CSS editor and lots of handy functions to outline different elements and so on that make learning this stuff a lot easier. |
|
|