Skip to content

Instantly share code, notes, and snippets.

@marioblas
Created October 5, 2014 15:49
Show Gist options
  • Save marioblas/d0deb499e006178647c3 to your computer and use it in GitHub Desktop.
Save marioblas/d0deb499e006178647c3 to your computer and use it in GitHub Desktop.
CSS - Inheriting box-sizing Probably Slightly Better Best-Practice
/**
* Inheriting box-sizing Probably Slightly Better Best-Practice.
* This will give you the same result, and make it easier to change the box-sizing in plugins or other components that leverage other behavior.
*
* Reference: http://css-tricks.com/inheriting-box-sizing-probably-slightly-better-best-practice/
*/
html {
box-sizing: border-box;
}
*, *:before, *:after {
box-sizing: inherit;
}
/* Designed to work in default box-sizing */
/* In your page, you could reset it to normal */
.component {
box-sizing: content-box;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment