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

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

问题描述

使用 Bootstrap,我有一个网格列 class="col-lg-3" 我想把它放在 position:fixed 而另一个 .col-lg-9 是正常位置(可滚动浏览页面).

<div class="col-lg-3">固定内容

<div class="col-lg-9">普通可滚动内容

就像LifeHacker.com中的左栏一样你会看到左边的部分是固定的,但我滚动页面.

我使用引导程序 v3.1.1

解决方案

按照这里的解决方案 http://jsfiddle.net/dRbe4/,

<div class="col-lg-3 固定">固定内容

<div class="col-lg-9 scrollit">普通可滚动内容

我修改了一些 css 使其完美运行:

.fixed {位置:固定;宽度:25%;}.srollit {向左飘浮;宽度:71%}

感谢@Lowkase 分享解决方案.

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>

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.

I use bootstrap v3.1.1

解决方案

Following the solution here 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>

I modified some css to work just perfect:

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

Thanks @Lowkase for sharing the solution.

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

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆