Skip to content

Instantly share code, notes, and snippets.

@shunchu
Created June 19, 2012 20:32
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 shunchu/2956372 to your computer and use it in GitHub Desktop.
Save shunchu/2956372 to your computer and use it in GitHub Desktop.
Define "100% - 50px" in css
/* Have padding and border that cut into the element's width instead expanding it. */
textarea {
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
}
/* reference: http://css-tricks.com/box-sizing/ */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment