Make column fixed position in bootstrap

后端 未结 7 878
南方客
南方客 2020-11-29 20:39

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

相关标签:
7条回答
  • 2020-11-29 21:29

    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.

    0 讨论(0)
提交回复
热议问题