Skip to content

Instantly share code, notes, and snippets.

@awakekat
Created July 4, 2014 01:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save awakekat/e738bca0a881e34c4bed to your computer and use it in GitHub Desktop.
Save awakekat/e738bca0a881e34c4bed to your computer and use it in GitHub Desktop.
This snippet of code should be placed into your css reset. It will save hours of frustration. You will thank me later. It has to with the box model and the included padding and margin. If a div is 100px tall and wide with padding of 10px it will expand to 120x120px. With the code below the div will not grow larger it will encapsulate and take on…
*, *::after, *::before {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment