Help - Search - Members - Calendar
Full Version: cascading order
HTMLHelp Forums > Web Authoring > Cascading Style Sheets
earthshaker
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
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
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
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.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2010 Invision Power Services, Inc.