DEV Community

Discussion on: Reset or not Reset CSS?

Collapse
 
ickas profile image
Henrique Macedo

Ps: you should fix the box-sizing declaration.

Can you explain?

Collapse
 
equinusocio profile image
Mattia Astorino

You have to set box-sizing on the html and let elements inherit the property value. By this way you can set a default box-sizing but still able change the behaviour when you need it.

html {
  box-sizing: border-box;
}

*, *::before, *::after {
  box-sizing: inherit;
}

More info here

Collapse
 
justinryder profile image
Justin Ryder

I always like to apply it to pseudo elements as well.

*,
*:before,
*:after {
  box-sizing: border-box;
}
Enter fullscreen mode Exit fullscreen mode