Skip to content

Instantly share code, notes, and snippets.

@marcialca
Created November 9, 2012 01:25
Show Gist options
  • Save marcialca/4043134 to your computer and use it in GitHub Desktop.
Save marcialca/4043134 to your computer and use it in GitHub Desktop.
[CSS] Full Width Textareas
textarea {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
}
Setting the box-sizing to border-box allows the textarea to respect its parent container's padding and border, recalculating what 100% actually means. If the box-sizing were content-box, the textarea would continue to stretch outside the parent container as it would have before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment