简体   繁体   English

css 破解垂直滚动条

[英]css hack for vertical scrollbars

if i make a div element have overflow:scrollbars i get both scroll bars vertical and horizontal all I want is the vertical scrollbars how do i accomplish that如果我让一个 div 元素溢出:滚动条我得到垂直和水平的滚动条我想要的只是垂直滚动条我怎么做到这一点

Instead of overflow use overflow-y in css.在 css 中使用overflow-y而不是overflow

overflow-y: String溢出-y:字符串

Specifies how to handle content overflow of an element if the content is too tall for the element.指定如果内容对于元素来说太高,如何处理元素的内容溢出。

Supported: IE 6.0+支持:IE 6.0+

But might not support some browsers so its better if you design your div so that elements do not exceed the x limit.但可能不支持某些浏览器,因此如果您设计 div 以使元素不超过 x 限制,则效果会更好。

You need你需要

overflow-y: visible溢出-y:可见

overflow-x: hidden溢出-x:隐藏

. . All the available options are listed here .此处列出了所有可用选项。

Here is your aswer这是你的回答

use overflow-y使用overflow-y

jscroll pane is very nice plugin for these kind of stuff jscroll 窗格是这类东西的非常好的插件

http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html http://www.kelvinluck.com/assets/jquery/jScrollPane/jScrollPane.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM