php - 固定列布局 bootstrap 3

标签 php html css twitter-bootstrap

我很好奇,一直在到处寻找。我正在尝试创建一个三列布局,其中左列和右列是粘性的,而中间列不是粘性的。我已经尝试将 data-spy="affix"添加到我的代码中,甚至设置一个偏移量,我可以让左列变得粘稠,但是添加 dataspy 时右列似乎嵌套在左列中。

代码如下:

<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>

此外,如果您想知道为什么它看起来很有趣,稍后内联 PHP 代码将包含一些 php 脚本...

编辑

CSS 代码

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

HTML代码

<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>

看起来 Center Column 位于 Center Column 的下方。偏移时它看起来很靠右。

enter image description here

代替

enter image description here

最佳答案

我在

找到了答案

http://bootply.com/101100

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

代替:

<div class="well span2">

对于每个侧边栏。

关于php - 固定列布局 bootstrap 3,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20641490/

相关文章:

html - 如何延迟此网页上某些云的开始?

jQuery .css() 不影响 div

javascript - 使用 javascript 在页面内加载新的 HTML 段

html - 仅在计算机屏幕上应用 CSS 规则,而不是在手机和平​​板电脑上

php - 从 Zend 和 PHP 配置对 MySQL 的数据库访问时遇到问题

javascript - Sweetalert2 重定向

javascript - ExtJS 6 图表 -- 更改标题颜色

html - 带有媒体查询的 flex 布局 - 边距不正确

PHP文件连接Mysql在Ubuntu操作系统中显示空白页

javascript - JQuery Post 将不起作用