Search code examples
csscss-reset

Does Reset.css affects other stylesheets?


I am starting a new project, so i thought to start using Reset.css in my projects. i got the concept of using Reset.css, but one thing is bothering me is that does if affects my other style applied on the same element.. like in reset.css div have 0 margin and 0 padding... and if i apply margin to some of the divs in my stylesheet, wont it get disturbed?

Please clear my this doubt


Solution

  • Not if the style applied to your other divs is more SPECIFIC.

    http://coding.smashingmagazine.com/2007/07/27/css-specificity-things-you-should-know/

    In general any style applied using a class, or an id in the selector is going to take precedence over one which doesn't. But there are many other rules in this area you should become aware of.

    i.e.

     div.myStyle {...}
    

    will always overrule

     div {...}