开发者

html form textarea formatting in different browsers

开发者 https://www.devze.com 2023-03-29 22:33 出处:网络
There is this form I have an开发者_StackOverflow社区d I would like the description field to be a textarea with the text box having the blue div as its background. I can adjust the rows and columns but

There is this form I have an开发者_StackOverflow社区d I would like the description field to be a textarea with the text box having the blue div as its background. I can adjust the rows and columns but problem is in google chrome it works but firefox it adds 2 extra rows which prevents me from fitting the textarea in the div properly...Any idea on what I can do about this?

http://jsfiddle.net/MwnSn/12/


Rather than specifying cols and rows, use CSS to specify height and width

You are a lot more likely to get a cross-browser result with this method.


You can style textareas with css width and height:

.the-blue-background {
    width: 300px;
    height: 300px;
}
.the-blue-background textarea {
    height: 100%;
    width: 100%;
}

Try it here: http://jsfiddle.net/MwnSn/14/

0

精彩评论

暂无评论...
验证码 换一张
取 消