0

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

Pal Singh
  • 1,964
  • 1
  • 14
  • 29

3 Answers3

1

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 {...}
BonyT
  • 10,750
  • 5
  • 31
  • 52
0

You have to include reset.css first and then include your own stylesheet file. and be sure that your styles wont be overwritten by reset.php.

rahim asgari
  • 12,197
  • 10
  • 43
  • 53
0

What you neeed to do is load reset.css as a first style sheet. Anything else loaded after it will be overriding reset.css

e.g if you specify in reset css: p { margin: 0px; padding: 0px} and than load style.css with style: p {margin: 2px; padding: 2px}

The style load as last one will be used.

I personaly use technic with

* { margin: 0px; padding: 0px; border: 0px; outline: none; list-style: none;}

Put it at the top of css file and job done:) No need for extra .css fil.

Iladarsda
  • 10,640
  • 39
  • 106
  • 170