Reputation: 3691
How can I set a textarea to 100% in width? it dosn't work when I say: textarea {width: 100%} in css.
Upvotes: 0
Views: 526
Reputation: 23907
There are several ways to fix this issue:
padding-right
equal to the accumulated border-width and padding of the textarea (supported by all browsers)Use the box-sizing
property to include border and padding when setting width:
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
(supported by IE8+ and all other browsers)
Upvotes: 2
Reputation: 28097
It does work but a parent element is probably just restricting the width of your <textarea>
so without seeing your code there's no specific answer to your question.
Upvotes: 0
Reputation: 27831
Make sure all of the parent elements have an appropriate width - post more information if that doesn't help.
Upvotes: 0