Created
November 9, 2012 01:25
-
-
Save marcialca/4043134 to your computer and use it in GitHub Desktop.
[CSS] Full Width Textareas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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