Bootstrap,如何在图像和文本之间添加空格?

时间:2016-04-29 15:11:54

标签: html css twitter-bootstrap

我有一个图像和一个文本并排,但现在我需要在每组文本和图像之间添加一些间距。我的代码。



.container {
  float: left;
  display: block;
  margin-top: 5%;
}

<div class="container">
  <!--Row with three equal columns-->
  <div class="row">
    <div class="col-md-4">
      <div class="demo-content">
        <img src="images/squareicon.png" class="pull-left">
        <h3>Versatile Spaces</h3>
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
      </div>
    </div>
    <div class="col-md-4">
      <div class="demo-content bg-alt">
        <img src="images/pointericon.png" class="pull-left">
        <h3>Central Location</h3>
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
      </div>
    </div>
    <div class="col-md-4">
      <div class="demo-content">
        <img src="images/foodicon.png" class="pull-left">
        <h3>Catering to Taste</h3>
        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
      </div>
    </div>
  </div>
</div>
&#13;
&#13;
&#13;

1 个答案:

答案 0 :(得分:2)

您可以为图片提供保证金:

.demo-content img {
    margin-right: 20px;
}