Log in

View Full Version : what order would the browser use for style sheets



ajfmrf
03-15-2013, 05:46 AM
For example,a webpage has links to 3 style sheets

1.css
2.css
3.css

and the there is some listed below on the page like:

<style type="text/css">
blah
blah
blah
</style>

I have a page that was mish mashed together and has css from 4 sources and some of it has different styles for the same thing-like body on one page is one color/size and is different on another.

Please help me-I don't have much hair left and I hope to keep it f or a while longer.lol

djr33
03-15-2013, 05:52 AM
https://www.google.com/search?q=order+loading+css
Looks like the first result (and maybe some others) have that information.

I *think* it's sequential (whichever is encountered in the code first), but I'm not positive about that or if there may be some exceptions.

The only true exception I know of is !important, which, if placed after a line of CSS, will make that override all other values.

ajfmrf
03-15-2013, 06:41 AM
I was wondering what that was about !important...

itivae
03-15-2013, 05:01 PM
If I understand correctly you are looking for the order of the cascade? If so this might help (the part on "6.4.3 Calculating a selector's specificity" was useful to me):

http://www.w3.org/TR/CSS21/cascade.html

good luck.