Bootstrap 3:修复div行 [英] Bootstrap 3 : fix div row
本文介绍了Bootstrap 3:修复div行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有两个div:
<div class="row">
</div>
<div class="row">
</div>
我需要在滚动时修复第一个.我是这样做的:
I need to fix the first one while scrolling. I did this :
<div style="position:fixed" class="row">
</div>
现在div重叠了: https://jsfiddle.net/DTcHh/22068/
我该如何解决?
推荐答案
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)
}
这篇关于Bootstrap 3:修复div行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文