HTML页面显示禁用的滚动条
我的html页面显示空的禁用滚动条,请参阅附加的屏幕截图 如何完全隐藏此滚动条 编辑: 对不起,我的错误,我没有提到我正在使用overflow:hidden,但无法隐藏此滚动条。 我在下面复制我的身体代码HTML页面显示禁用的滚动条,html,css,Html,Css,我的html页面显示空的禁用滚动条,请参阅附加的屏幕截图 如何完全隐藏此滚动条 编辑: 对不起,我的错误,我没有提到我正在使用overflow:hidden,但无法隐藏此滚动条。 我在下面复制我的身体代码 body { color: #000000; margin-bottom: 0; margin-left: 0; margin-right: 0; margin-top: 0; overflow-x: hidden; overflow-y: hidden; } 设置溢出:隐藏: body
body {
color: #000000;
margin-bottom: 0;
margin-left: 0;
margin-right: 0;
margin-top: 0;
overflow-x: hidden;
overflow-y: hidden;
}
设置
溢出:隐藏在CSS中为主体编写代码>:
body {
overflow: hidden;
}
或者只处理垂直滚动条
body {
overflow-y: hidden;
}
我怀疑它与您的正文元素上的溢出无关。
即使您设置了overflow-y
和overflow-x
,这就像使用速记一样:
与您的页边距相同,请仅使用:
margin: 0;
// You have also other shorthand variants like:
// margin : top right bottom left;
// margin : topBottom rightLeft;
// margin : top rightLeft bottom;
// helps to keep your CSS file clear as possible.
因此,可能的问题在于一些最外部的公共父元素,比如一些包装器或容器,其样式可能设置为overflow:scroll代码>
类似于可能的重复:。您正在使用哪个浏览器?尝试溢出:隐藏,而不是x/y指令。为什么不简单地使用Inspect元素并使用控制台CSS编辑器呢?我怀疑它与body
无关,但对于最外层的父容器,我知道有溢出和边距的速记,我从firebug复制了这个css,这就是为什么它不使用速记:P,尽管如此,我最上面的元素是溢出滚动,所以我删除了它,现在问题解决了。@Asad很高兴你这么做了!
margin: 0;
// You have also other shorthand variants like:
// margin : top right bottom left;
// margin : topBottom rightLeft;
// margin : top rightLeft bottom;
// helps to keep your CSS file clear as possible.