制作两个COL Bootstrap 3相同的高度,但带有填充

时间:2014-03-27 15:20:33

标签: html5 css3 height twitter-bootstrap-3 css-tables

我想看起来像这样,没有javascript的buit,这里是我想要的截图

enter image description here

这就是我现在在boostrap 3,css in inline中所做的,因为我使用的更少,这很简单:)

HTML

 <section class="container-fluid" style="background-color:Red;
  background-size: cover; padding-top:145px; padding-bottom:145px;">
    <div class="container">
      <div class="row">
       <div class="col-md-6">
       <div class="element" style="background-color:white;  opacity:.90;
  -moz-opacity:.90; 
  filter:alpha(opacity=90); padding-top:20px; padding-bottom:20px; margin-top:20px; margin-bottom:44px; margin-right:15px; padding-left:15px;">
              <h2  class="color-brand">HEADING 2</h2>
              <p class="color-grey">Hello Mate</p>
            </div>
            </div>
   <div class="col-md-6">
        <div class="element" style="background-color:white;  opacity:.90;
  -moz-opacity:.90; 
  filter:alpha(opacity=90); padding-top:20px; padding-bottom:20px; margin-top:20px; margin-bottom:44px; margin-right:15px; padding-left:15px;">
              <h2  class="color-brand">HEADING 2</h2>
              <p class="color-grey">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
            </div>
            </div>
          </div>
</section>

这就是jfiddle

http://jsfiddle.net/D9tc4/

1 个答案:

答案 0 :(得分:0)

你可以像这样使用负边距..

.element{
    padding:20px;
    margin-bottom: -99999px;
    padding-bottom: 99999px;
}

演示:http://www.bootply.com/125300