dqppv86022 2013-12-17 18:03
浏览 13
已采纳

固定列布局引导程序3

I am curious, and I have been looking everywhere. I am trying to create a three column layout where the left, and right columns are sticky, and the center column is not sticky. I have tried adding the data-spy="affix" to my code, and even set an offset, I can get the left column to become sticky, but the right column when adding the dataspy appears nested within the left column.

Code Below:

<div class="container-fluid">
    <div class="row-fluid">
        <div class="well span2"><?="Left Column";?></div>
        <div class="well span8"><?="Center Column";?></div>
        <div class="well span2"><?="Right Column";?></div>
    </div>
</div>

Also, inline PHP code will contain some php scripts later on if you are wondering why it looks funny...

Edit

Css Code

.stick_r {
    position:fixed;
    right:10px;
}
.stick_l {
    position:fixed;
    left:10px;
}

HTML Code

<div class="container-fluid">
    <div class="row-fluid">
        <div class="well span2 stick_l">Left Column</div>
        <div class="well span8">Center Column</div>
        <div class="well span2 stick_r">Right Column</div>
    </div>
</div>

Looks like Center Column is underneath the Center Column. When offsetting it appears way to far to the right.

enter image description here

Instead of

enter image description here

  • 写回答

2条回答 默认 最新

  • dongzhi6382 2013-12-17 18:22
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
  • dongli7236 2013-12-17 19:00
    关注

    I found the answer at

    http://bootply.com/101100

    <div class="sidebar-nav-fixed pull-right affix">
    

    Instead of:

    <div class="well span2">
    

    for each sidebar.

    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 c++图Djikstra算法求最短路径
  • ¥15 Linux操作系统中的,管道通信问题
  • ¥15 ansible tower 卡住
  • ¥15 等间距平面螺旋天线方程式
  • ¥15 通过链接访问,显示514或不是私密连接
  • ¥100 系统自动弹窗,键盘一接上就会
  • ¥50 股票交易系统设计(sql语言)
  • ¥15 调制识别中这几个数据集的文献分别是什么?
  • ¥15 使用c语言对日志文件处理
  • ¥15 请大家看看报错原因,为啥会这样