开发者

html form textarea formatting in different browsers

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜