在twitter bootstrap中连续放了几个col *

时间:2014-07-18 15:17:31

标签: css css3 twitter-bootstrap twitter-bootstrap-3

我想在一个<div class"col-*">元素中嵌入多个<div class="row">,这些条件在<div class"col-*">元素之间左右存在填充。

<div class="row">
  <div class="col-xs-12 col-md-6 color"> sdf sdf sdfds sdf dsf ds fsd sfsd fsd </div>
  <div class="col-xs-12 col-md-6 color"> sdf sdf sdfds sdf dsf ds fsd sfsd fsd </div>
  <div class="col-xs-12 col-md-6 color"> sdf sdf sdfds sdf dsf ds fsd sfsd fsd </div>
  <div class="col-xs-12 col-md-6 color"> sdf sdf sdfds sdf dsf ds fsd sfsd fsd </div>
  <div class="col-xs-12 col-md-6 color"> sdf sdf sdfds sdf dsf ds fsd sfsd fsd </div>
</div>

see example

1 个答案:

答案 0 :(得分:0)

简单地说是一个保证金。

这里是fiddle

<强> HTML:

<div class="row">
    <div class="col-xs-12 col-md-6 color"> sdf sdf sdfds sdf dsf ds fsd sfsd fsd </div>
    <div class="col-xs-12 col-md-6 color"> sdf sdf sdfds sdf dsf ds fsd sfsd fsd </div>
    <div class="col-xs-12 col-md-6 color"> sdf sdf sdfds sdf dsf ds fsd sfsd fsd </div>
    <div class="col-xs-12 col-md-6 color"> sdf sdf sdfds sdf dsf ds fsd sfsd fsd </div>
    <div class="col-xs-12 col-md-6 color"> sdf sdf sdfds sdf dsf ds fsd sfsd fsd </div>
</div>

<强> CSS:

[class^="col-"], [class*=" col-"] {
  margin:0 20px;
}