I want a to completely fill an absolutely-sized parent container, with padding in the textarea. I have this working for Chrome using the follow
This is a case where I highly recommend changing the markup (it wont even hurt the semantics):
HTML
CSS
.textarea-label
{
display: block;
/* border, padding, and other styles go here,
don't set the height, and don't use floats or positioning */
}
.textarea-label textarea
{
border: 0 none;
margin: 0;
outline: 0 none;
padding: 0;
width: 100%;
}
You should still be able to resize the textarea vertically without issues. If you use inline-block
for the label, you should be able to resize horizontally as well.
The advantage of using the label is that clicking on the label will still focus the textarea as if you had clicked on the textarea. Additionally, using the descendant selector, you'll preserve your default textarea styles when you just need a plain-ol' textarea.