Reputation: 1077
When I set the width of an input and a text area to 94% they appear to be slightly different in width. This is something I have seen many times on many sites.
Can anyone explain why a textarea is not as wide as an input when set to the same % width?
input, textarea {
width: 94%;
}
Upvotes: 9
Views: 6447
Reputation: 10687
With CSS3 you can also use:
-webkit-box-sizing: border-box; /* Safari/Chrome, other WebKit */
-moz-box-sizing: border-box; /* Firefox, other Gecko */
box-sizing: border-box; /* Opera/IE 8+ */
Upvotes: 9
Reputation: 219804
Upvotes: 11