简体   繁体   English

如何隐藏水平滚动条?

[英]How to Hide horizontal scrollbars?

Following is the css for my body: 以下是我的身体的CSS:

body{
margin: 0px;
width: 100vw;
height: 100vh;
}

I have some divs that extend beyond the viewport on the right side (there is no way around it, that is just how my design is setup). 我有一些div超出了右侧的视口(没有办法围绕它,这就是我的设计设置的方式)。 However, I do not want to make the page scrollable horizontally. 但是,我不想使页面水平滚动。

This is the jsfiddle for the divs that are extending beyond the viewport (the red stripes are long, and the jsfiddle is not properly optimized, so its not exactly how it looks in a full browser screen), https://jsfiddle.net/gxk985kb/ 这是div延伸到视口之外的jsfiddle(红色条纹很长,并且jsfiddle没有得到适当的优化,因此在整个浏览器屏幕上的外观也不完全一样), https: //jsfiddle.net/ gxk985kb /

How can I just not allow the horizontal scrolling at all? 我怎样才能根本不允许水平滚动?

Try "overflow-y:hidden;" 尝试“ overflow-y:hidden;” for #designWrapper. 适用于#designWrapper。 This way you can remove the horizontal scroll. 这样,您可以删除水平滚动。

 <svg style="background-color: #dedede;" fill="red" width="400" height="200"> <path d="M 10 190 L 60 190 L 110 10 L 60 10 Z" /> <path d="M 70 190 L 120 190 L 170 10 L 120 10 Z" /> <path d="M 130 190 L 180 190 L 230 10 L 180 10 Z" /> <path d="M 190 190 L 240 190 L 290 10 L 240 10 Z" /> </svg> 

i think you should make your design with svg. 我认为您应该使用svg进行设计。 it is more suitable for like this design. 它更适合像这样的设计。 CSS transform property is supported by min ie 10 (-ms- ie9). 最小即10(-ms-ie9)支持CSS变换属性。

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

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