eha*_*abd 49 grid twitter-bootstrap
两列布局,中间有一条线.
[ ] | [ ]
[ ] | [ ]
[ ] | [ ]
[ Left Column ] | [ Right Column ]
[ ] | [ ]
[ ] | [ ]
[ ] | [ ]
[ ] | [ ]
Run Code Online (Sandbox Code Playgroud)
小智 81
我的解决方案使用:before伪元素在列之间放置一个定位元素.这不再需要HTML元素,只会应用于类的直接子.col-*元素.border-between.这应该应用于与...相同的元素.row.
HTML
<div class="row border-between">
<p class="col-sm-6">This column does not have a border, because it's a first child.</p>
<p class="col-sm-6">This column has a border to the left</p>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS
.border-between > [class*='col-']:before {
background: #e3e3e3;
bottom: 0;
content: " ";
left: 0;
position: absolute;
width: 1px;
top: 0;
}
.border-between > [class*='col-']:first-child:before {
display: none;
}
Run Code Online (Sandbox Code Playgroud)
Gar*_*ryP 57
我想我的问题是对的...这是下面的代码.下面的内联样式仅供参考.您在CSS文件中应用样式.
<div class="container">
<div class="row-fluid">
<div class="span6" style="padding-right:20px; border-right: 1px solid #ccc;">
<p>Some Contents Here...</p>
</div>
<div class="span6">
<p>Some Contents Here...</p>
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
上面的代码将输出该图像.

Ann*_*ire 29
基于@Ross Angus解决方案,我找到了一种适应高度的方法.只需将每列的边框放在彼此的顶部.
.grid--borderBetween > [class*='col-']:before,
.grid--borderBetween > [class*='col-']:after {
background: #b2b2b2;
bottom: 0;
content: " ";
position: absolute;
width: 1px;
top: 0;
}
.grid--borderBetween > [class*='col-']:before {
left: 0;
}
.grid--borderBetween > [class*='col-']:after {
right: -1px;
}
.grid--borderBetween > [class*='col-']:first-child:before,
.grid--borderBetween > [class*='col-']:last-child:after {
display: none;
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
70785 次 |
| 最近记录: |