css相对页脚和固定侧边栏相互重叠

时间:2015-12-31 10:31:23

标签: css

我研究了很多,找不到解决问题的方法。页脚与固定侧栏重叠。我想防止div相互重叠。请你帮助我好吗。 Z-index并没有解决问题。

#sidebar {
    margin: 140px 0px 0px 572px;
    float: right;
    width: 226px;
    position: fixed;
}
#footer {
    clear: both;
    height: 55px;
    width: 100%;    
    position: relative;    
}

1 个答案:

答案 0 :(得分:0)

通过为侧边栏提供背景颜色或图像来使其不透明。

例如:https://jsfiddle.net/a3t22856/

我添加的内容是:

background-color: white;