SandySynaptik Posted March 30, 2012 Share Posted March 30, 2012 Is it important to define body element first before defining div elements? like: body { background : #123456;} #div1 { foo: bar;} or is it also valid if div element is written first, like: #div1 { foo: bar;} body { background : #123456;} Link to comment Share on other sites More sharing options...
regicidedelferoz Posted March 30, 2012 Share Posted March 30, 2012 i think it's valid,. Link to comment Share on other sites More sharing options...
eTianbun Posted March 30, 2012 Share Posted March 30, 2012 (edited) Well, it's valid, just that browsers, will first of all assign the color to the div, before the body. For some reasons, it is best to make the #body be the first..." GOD created heaven and earth, before the animals/humans and not the other way round...Lol..." make the #body 1st! Edited March 30, 2012 by eTianbun Link to comment Share on other sites More sharing options...
Ingolme Posted March 31, 2012 Share Posted March 31, 2012 The order doesn't make a difference. It's just easier to understand the stylesheet if the selectors are in order 1 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now