Double div“container body-content”标记在Bootstrap 3.0中无法正确对齐

时间:2014-06-26 12:21:49

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

为什么使用两次<div class="container body-content">标记,我在页面右侧的对齐方式不正确?文字超越了右边界。

以下是我的网页的实时版本:

编辑: http://www.bootply.com/L22KmZFgrt

这是HTML,谢谢。

<div class="container body-content">
    <div class="row">
        <div class="col-md-4" >
            <h2>Lorem ipsum dolor sit amet</h2>
            <p>Lorem ipsum dolor sit amet, cetero veritus mei ne, omnium propriae mel eu.</p>
            <p><a href="#" class="btn btn-primary btn-large">Learn more</a></p>
        </div>
    </div>
</div>
<div class="container body-content" style="position: absolute; top:400px">
    <div class="row">
    <div class="col-md-4">
   <p>Lorem ipsum dolor sit amet, cetero veritus mei ne, omnium propriae mel eu. Eos putant signiferumque id, id mea nulla ceteros, an nonumy graeco everti his. Eam corrumpit consequat id. In nec audire accusamus, cu his velit denique aliquando. Ne nulla oratio feugiat ius, usu ut tibique intellegam.</p>
    </div>
    <div class="col-md-4">
   <p>Lorem ipsum dolor sit amet, cetero veritus mei ne, omnium propriae mel eu. Eos putant signiferumque id, id mea nulla ceteros, an nonumy graeco everti his. Eam corrumpit consequat id. In nec audire accusamus, cu his velit denique aliquando. Ne nulla oratio feugiat ius, usu ut tibique intellegam.</p>
    </div>
    <div class="col-md-4">
   <p>Lorem ipsum dolor sit amet, cetero veritus mei ne, omnium propriae mel eu. Eos putant signiferumque id, id mea nulla ceteros, an nonumy graeco everti his. Eam corrumpit consequat id. In nec audire accusamus, cu his velit denique aliquando. Ne nulla oratio feugiat ius, usu ut tibique intellegam.</p>
    </div>
  </div>
</div>

1 个答案:

答案 0 :(得分:1)

问题是一种相对于另一种的定位问题,我用这个很好的答案解决了:Position absolute but relative to parent