I just had a quick css form question. I am trying to get the textarea's rows, and cols attribute set in css. So for example how can I do this in CSS.
+3
A:
width
and height
are used when going the css route.
.comments { width:300px; height:75px; }
<textarea class="comments"></textarea>
Jonathan Sampson
2010-01-09 19:04:39
A:
As far as i know you cant.
Besides, that isnt what css is for anyway. Css for styling and HTML for markup.
EDIT: Cool, i stand corrected.
Moulde
2010-01-09 19:05:53
CSS is for styling the visual representation of an element. This includes the width and height of a textarea.
Jonathan Sampson
2010-01-09 19:07:00
Yeah, exactly.I didn't know cols and rows, and width and height were the same.
Moulde
2010-01-09 19:12:26
Moulde, you're correct in that they're not *exactly* the same. But they both achieve the same purpose :)
Jonathan Sampson
2010-01-09 19:16:30
A:
I don't think you can. I always go with height and width.
textarea{
width:400px;
height:100px;
}
the nice thing about doing it the CSS way is that you can completely style it up. Now you can add things like:
textarea{
width:400px;
height:100px;
border:1px solid #000000;
background-color:#CCCCCC;
}
Code Monkey
2010-01-09 19:07:33