I'm curious why overflow: auto;
rule adds scrollbar in this case
CSS:
textarea {
width: 100%;
margin:0;
padding:0;
}
.span4 {
width: 300px;
}
aside {
overflow: auto;
}
html:
<aside class="span4">
<textarea cols="40" rows="20"></textarea>
</aside>
http://jsfiddle.net/ZnsW9/ If this textarea has 100% width, and without margins and paddings, how is that overflowing the container box?
Used to box-sizing
textarea {
width: 100%;
margin:0;
padding:0;
-webkit-box-sizing:border-box;
-moz-box-sizing:border-box;
box-sizing:border-box;
}
Demo
Scrollbar is added because of border. Add border: none;
rule to textarea:
textarea {
width: 100%;
margin:0;
padding:0;
border: none;
}
Demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With