获取TextArea以在浏览器中看起来相同?

时间:2013-07-11 19:50:42

标签: html5 css3 cross-browser

我没有找到这个问题的满意答案,所以我走了,

这就是 textarea Chrome 上的显示方式:

enter image description here 这是同一页面在 FireFox

上的显示方式

enter image description here

这是textarea的HTML:

<textarea class="t-field" cols="58" id="message" name="message" rows="6"></textarea>

所以,我想知道的是...... 什么是CSS 技巧让textareas在浏览器中表现和看起来相同?

提前感谢您的回答, 亲切的问候!

2 个答案:

答案 0 :(得分:3)

不要使用colsrows属性,请尝试使用CSS widthheight属性

答案 1 :(得分:1)

正如已经指出的那样,您应该使用widthheight来确定区域的大小。行和列将根据浏览器使用的字体大小而有所不同,并且可能对解释中的其他变体开放。

相关问题