隐藏html水平但不垂直滚动条 [英] Hide html horizontal but not vertical scrollbar

查看:151
本文介绍了隐藏html水平但不垂直滚动条的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个html textarea是固定宽度,但可变高度。我想设置overflow:scroll和能够显示一个垂直滚动条,但不是一个水平的。我不能使用overflow:auto由于其他事情特定于我的情况。

I have an html textarea that is of fixed width, but variable height. I would like to set overflow:scroll and be able to show a vertical scrollbar, but not a horizontal one. I am not able to use overflow:auto due to other things specific to my situation.

我知道没有办法使用CSS 2只显示垂直但不水平滚动条。

I know there is no way using CSS 2 to show only vertical but not horizontal scrollbars. Is there anything I can do with javascript to hide the horizontal scrollbar?

推荐答案

你可以这样使用css:

You can use css like this:

overflow-y: scroll;
overflow-x: hidden;

这篇关于隐藏html水平但不垂直滚动条的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆