为什么我的标题没有固定到列。

时间:2014-07-21 19:32:49

标签: html css css3

为什么我的headerfixedcolumn

<div class="container-fluid full-ht">
    <div class="row full-ht">
        <div class="col-sm-4 full-ht">
          <div class="patient-column full-ht">
            <div class="fixed-header">
              Fixed Header
            </div>
            Some content follows
          </div>
        </div>
    </div>
</div>

我希望headercolumn发生时固定在vertical-scrolling内。 http://www.bootply.com/tducyvW5u1

2 个答案:

答案 0 :(得分:3)

你应该使用

position:fixed

用于固定标题,在滚动时实现固定标题

<强> CSS

.fixed-header {
position: fixed; // changed position:absolute to fixed
width: 100%;
top: 0;
padding: 15px;
}

答案 1 :(得分:0)

在我的CSS中,我会添加!important并将absolute设为fixed并将其作为优先事项。

.fixed-header {
  position: fixed; !important
  width: 100%;
  top: 0;
  padding: 15px;
}