使列固定在引导程序中的位置 [英] Make column fixed position in bootstrap

查看:157
本文介绍了使列固定在引导程序中的位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Bootstrap,我有一个网格列类=col-lg-3,我想把它放在位置:固定而另一个.col-lg-9是正常位置(可滚动通过页面) 。

Using Bootstrap, I have a grid column class="col-lg-3" that I want to place it in position:fixed while the other .col-lg-9 is normal position (scroll-able through the page).

<div class="row">
    <div class="col-lg-3">
        Fixed content
    </div>
    <div class="col-lg-9">
        Normal scrollable content
    </div>

</div>

LifeHacker.com
你会看到左边的部分是固定的,但我滚动页面。

Just the same way like the left column in LifeHacker.com You will see that the left part is fixed however I scroll though the page.

我使用bootstrap v3.1.1

I use bootstrap v3.1.1

推荐答案

按照此处的解决方案 http:// jsfiddle.net/dRbe4/

<div class="row">
    <div class="col-lg-3 fixed">
        Fixed content
    </div>
    <div class="col-lg-9 scrollit">
        Normal scrollable content
    </div>

 </div>

我修改了一些css来完成工作:

I modified some css to work just perfect:

.fixed {
        position: fixed;
        width: 25%;
}
.scrollit {
        float: left;
        width: 71%
}

感谢@Lowkase共享解决方案。

Thanks @Lowkase for sharing the solution.

这篇关于使列固定在引导程序中的位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆