I have width:100%
for a textarea, but my textarea stretches all the way to the page's border by default. Is there anyway to fix this?
I'm trying to make this responsive so that the textarea's maximum width is cols="100"
, but it will also shrink if needed.
textarea {
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
width: 100%;
resize: none;
}
<textarea cols="100" rows="10" name="savetext" id="savetext"></textarea>