giovanni Posted April 28, 2012 Share Posted April 28, 2012 hi guys, first sorry for my ad english, i'm a newbie about css and i need an help about some rule: what is the difference betwwen these two rules? html {padding:0px; margin:0px} body{padding:0px; margin:0px} the intepretation of this ruls div#extra div.newsbox p{margin: 0} is all paragraph inside div with class newsbox internal to div with id equal to extra has all margin set to zero is correct tanksGiovanni Link to comment Share on other sites More sharing options...
eTianbun Posted April 28, 2012 Share Posted April 28, 2012 (edited) (1) html{[...]}, sets zero margin/padding for the <html> element, while body{[...]}, sets it for the <body> element.(2) div#extra div.newsbox p{[...]} Any <p>, inside a <div> with id="newsbox", and the <div> with id="newsbox", is also inside another <div>, with class="extra". Edited April 28, 2012 by eTianbun Link to comment Share on other sites More sharing options...
Ingolme Posted April 28, 2012 Share Posted April 28, 2012 You mixed up the class and ID selectors there. A hash # is the ID selector while a dot . is a class selector. A space between two selectors means that the selector on the right is a descendent of the selector on the left. 1 Link to comment Share on other sites More sharing options...
eTianbun Posted April 28, 2012 Share Posted April 28, 2012 You mixed up the class and ID selectors there. A hash # is the ID selector while a dot . is a class selector. A space between two selectors means that the selector on the right is a descendent of the selector on the left. Opse, my bad! I use mobile phone, so i find it difficult to spot error(s) sometimes, thats why i always edit my post... Thanks for that 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