How to disable default scroll bar for textareas in IE8?

佐手、 提交于 2019-12-09 15:32:24

问题


I am going through some of my older sites where I have a contact form and in IE8 there always is a vertical scroll bar displayed for my textareas, even when there is no content.

In Firefox, it doesn't seem to make the vertical scroll bar exist until the content in the textarea reaches a height that deems them necessary.

I have styled my input boxes on my older sites, and a scroll bar appearing by default makes them look quite ugly.

My question, is there anything I can do about this, or is it just a default IE8 behaviour?

I've tried setting overflow: auto but it has not worked.


回答1:


I can't test on IE8 right now, but I can tell you that this works in IE6:

textarea {
  overflow-y: auto;
}



回答2:


Use overflow: hidden and all will be well.

<HTML>
    <BODY>
        <textarea rows="10" style="overflow: hidden;"/>
    </BODY>
</HTML>


来源:https://stackoverflow.com/questions/1210078/how-to-disable-default-scroll-bar-for-textareas-in-ie8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!