earthshaker
Dec 9 2008, 07:21 PM
I have been playing with some CSS stuff the past few days but, I can't seem to find the answer anywhere.
I am pretty sure there is a proper order for cascading, what I have on a template is (from top to bottom)
body, page, header, sidebar header, sidebarnav, sidebarnav a, widget, mainarea, contentarea, sidebar, footer, footer a, h1, h1 a, and, description a, .
Now all I can find is the selectors in alphabetical order, what is the actual order? Is there a complete listing somewhere?
Darin McGrew
Dec 9 2008, 08:02 PM
The order matters only when two (or more) declarations have the same weight, origin and specificity. In that case, the last declaration specified wins.
Otherwise, put them in whatever order you want.
earthshaker
Dec 9 2008, 09:06 PM
OK I did some reading and read about weight, origin and specificity. Now all I have to do is read more and learn what those terms really mean, and learn how to tell which is which.
TFTR, R
Brian Chandler
Dec 9 2008, 09:21 PM
QUOTE
OK I did some reading and read about weight, origin and specificity. Now all I have to do is read more and learn what those terms really mean, and learn how to tell which is which.
You need to be a bit careful here -- you will need to understand what *CSS* means by these terms, and CSS regularly abuses terms to mean something quite unlike their real meaning. In particular CSS_specificity does not always rate more specific statements above less specific ones.