overflow属性返回自动值 [英] overflow property returning auto value

查看:204
本文介绍了overflow属性返回自动值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经应用了 html,body {width:100%; overflow-x:hidden;} 隐藏溢出的html,但它导致滚动条似乎已写为 overflow-x:auto; 。为什么会发生这种情况?

I've applied html,body{width: 100%; overflow-x: hidden;} to hide the overflowing html but it's causing the scrollbar seems it has been written as overflow-x: auto;. Why is this happening?

这里是屏幕截图:

在Firefox 26.0中测试,Google Chrome版本32.0.1700.76 m

Tested in Firefox 26.0, Google Chrome Version 32.0.1700.76 m

推荐答案

如果您只是想移除内部垂直滚动条,代替:

If you are just wanting to remove the inner-vertical scrollbar, you would use the following instead:

html, body {
    overflow-x: hidden;
}
body {
    overflow-y: hidden;
}

隐藏 html / / 元素并指定 overflow-y:hidden 元素来删除生成的内垂直滚动条。这将保留 html 元素上的外部水平滚动条。

Hide the horizontal scrollbar on both the html/body elements and specify overflow-y: hidden on the body element to remove the inner-vertical scrollbar generated. This will preserve the outer horizontal scrollbar on the html element.

这篇关于overflow属性返回自动值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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