5

我有一个带有在页脚中创建的菜单栏的 Html 页面。目前,整个页面是可滚动的。如何限制页脚的滚动。所以,我正在寻找仅在页面内容上滚动。

页脚菜单栏的代码如下:

#menu-bar {
    height: 50px;
    position: fixed;
    left: 0px;
    bottom: 0px;
    width: 100%;
    margin: 0px;
    padding: 0px;
    line-height: 10px;
    background: #F07C1F;
    z-index: 1000;
}
4

1 回答 1

1

定位元素,就是你要找的……

http://jsfiddle.net/7fuQm/1/

#menu-bar {
    height: 50px;
    position: absolute;
    left: 0px;
    bottom: 0px;
    width: 100%;
    margin: 0px;
    padding: 0px;
    line-height: 10px;
    background: #F07C1F;
    z-index: 1000;
}
#body {
    position: absolute;
    top:0px;
    bottom:50px;    
    left: 0px;   
    overflow:auto;
}
p
{
    margin: 10px;
}
于 2012-11-23T13:23:09.643 回答