9

我正在尝试摆脱出现在我整理的此页面上的明显不需要的第二个垂直滚动条,请参阅http://abchealth.info/doc-mike-special/test3/

我在这里的研究使我尝试从我的 CSS 中删除“溢出”,但这绝对破坏了我的布局,所以我正在寻找一种解决方案,可以在不更改任何其他内容的情况下删除内部垂直滚动条......

非常感谢您的帮助,谢谢!

这是我的CSS:

/* Generated by KompoZer */


body {
background-image: url(http://abchealth.info/images/bg.png);
}


html, body {
margin: 0;
padding: 0;
height: 100%;
min-height: 100%;

}


div#wrap {min-height: 100%;}

div#mastercontainer {
overflow:auto;  width: 100%;
height: 100%;
min-height: 100%;
}

div#header {
background-image: url(http://abchealth.info/images/header-bg.jpg);  background-repeat:   
repeat-x;
position: top; height: 96px;}


div#content {
}


div#innercontentmiddle {
margin: 0 auto;
width: 540px;
padding:10px;    padding-bottom:510px;}


div#footerclear {
}



div#footer {
position:relative;  margin-top: -510px; height: 510px; clear:both;
background-image: url(http://abchealth.info/images/footer-bg.jpg);  background-repeat:   
repeat-x;}


/*Opera Fix*/
body:before {
content:"";
height:100%;
float:left;
width:0;
margin-top:-32767px;/
}
4

6 回答 6

14

改变这个:#mastercontainer {overflow:auto;}#mastercontainer {overflow: visible;}

如果内容对于框架来说太大,正在发生的事情是“自动”使用滚动条。也就是 div 或 w/e 需要放大以避免滚动。可见会让它像我想的那样溢出。可见甚至隐藏都可以与此代码一起使用——css 就是关于玩耍和试验的。

***大多数浏览器都提供一个名为“FireBug”的插件 -> 下载它。它允许您在查看时编辑网页的 css 等。对于 css 样式错误非常有用。强烈推荐用于此类问题。

于 2012-08-15T14:21:14.260 回答
2

这有效

#mastercontainer { overflow: hidden; }

或上述解决方案也有效。

于 2012-08-15T14:20:46.353 回答
1

overflow:auto从中删除div#mastercontainer

于 2012-08-15T14:20:03.683 回答
0

如果问题是由于 html, body { overflow-x: hidden;} 那么尝试使用 html, body{height: 100%;} 它对我来说很好。

于 2018-01-02T11:02:35.523 回答
0

在许多情况下,将overflow-y 设置为'hidden' 可以移除垂直滚动条。可以将其设置为“可见”,因为这意味着溢出是可见的,这意味着不需要滚动,因此滚动条不可见。

然而,这些设置并不总是有效,因为 https://developer.mozilla.org/en-US/docs/Web/CSS/overflow上所说的:

为了使溢出产生效果,块级容器必须具有设置高度(高度或最大高度)或空白设置为 nowrap。

上面的链接是尝试了解“溢出”一般如何工作的好资源,它并不像您希望的那么简单。

例如,另一个注释,从那里:

将一个轴设置为可见(默认),而将另一个轴设置为不同的值会导致可见行为为自动。

于 2018-11-26T00:44:40.993 回答
0

对于使用ion-icons 和 bootstrap的任何人,问题可能在 ionic/structure.css 中。我在网站和ionic/structure.css中使用了 ion-icons,我发现这两个属性导致了问题,并且更改它们解决了问题。

{
  overflow: hidden;
  overscroll-behavior-y: none;
}

变成:

{
  overflow: scroll;
  overscroll-behavior-y: scroll;
}
于 2020-06-06T03:19:22.217 回答