我有两个div:
<div class="row">
</div>
<div class="row">
</div>
我需要在滚动时修复第一个。我这样做了:
<div style="position:fixed" class="row">
</div>
现在div正在重叠:https://jsfiddle.net/DTcHh/22068/
我该如何解决这个问题?
答案 0 :(得分:2)
HTML:
<div class="row fixed"></div>
<div class="row padding"></div>
CSS:
.fixed {
position: fixed;
background: #fff;
z-index: 10;
width: 100%;
}
.padding {
padding-top: 54px // height of your fixed row, you have to change this value on different screen sizes (using media queries)
}