【问题标题】:how do i prevent scrolling on my page? [duplicate]如何防止在我的页面上滚动? [复制]
【发布时间】:2017-09-24 13:52:30
【问题描述】:

大家好,我希望我的网页能够显示所有内容 向下或向上滚动以查看任何内容。请问我该怎么做? 这给我带来了一些困难。

这是我的 layout.css

body {
    margin:0;
    padding:0;
}
#Holder {
    width:980px;
    height: auto;
    margin-left: auto;
    margin-right: auto;
    margin-top: 21px;
    margin-bottom: 21px;
}
#Header {
    height: 150px;
    background-repeat: no-repeat;
    margin-bottom: 11px;
}
#NavBar {
    height: 60px;
    background-color:rgb(13, 13, 13);
}
#Content {
    height:auto;
    clear:both;
    overflow:auto;
}
#PageHeading {
    height:auto;
    padding:11px;
}
#ContentLeft {
    width:280px;
    float:left;
    padding-top:11px;
    padding-left:11px;
}
#ContentRight {
    width:680px;
    float:right;
}
#Footer {
    height:100px;
    vertical-align: bottom;
    width:50%;
    position: relative;
}

【问题讨论】:

  • 这个问题和我问的不一样。

标签: javascript php css


【解决方案1】:

将其中一项添加到您的代码中:

溢出-x:隐藏; 会隐藏 x 轴上超出元素的任何东西,因此不需要水平滚动条并将其移除。

溢出-y:隐藏; 会隐藏 y 轴上超出元素的任何东西,因此不需要垂直滚动条,它会被移除。

溢出:隐藏; 将删除两个滚动条

【讨论】:

  • 我希望页面在隐藏滚动按钮后显示网页上的全部内容。请问我该怎么做?
猜你喜欢
  • 2017-09-24
  • 1970-01-01
  • 2020-05-16
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多