如何减少两个引导行之间的垂直空间/边距?

时间:2015-12-11 06:01:29

标签: html css twitter-bootstrap

以下是我的代码,我想要" portfolio1Info" div元素行垂直相邻,没有空格/边距到" portfolioSite" div元素行。我试过.noBottomMargin {margin-bottom:0px!important;},。noTopMargin {margin-top:0px!important}。它似乎无法工作,我总是在图像和图像行后面的行之间留下空隙

      

    <div id="portfolio1" class="col-lg-4" style="border:solid">
      <div class="row">
        <div class="col-lg-12">
        <a href="www.placekitten.com" target="_blank"><img class="img-responsive" src="http://s.wordpress.com/mshots/v1/http%3A%2F%2Fwww.placekitten.com?" border="1" /></a>
        </div>
        </div>
      <div id="portfolio1Info" class="row">
        <div class="col-lg-12">
          <div style="background-color:#000000">
          <h5 align="center"> Please hold 1? </h5>
          <h6 align="center"><i> HTML? </i></h6>
          </div>
        </div>
      </div>
    </div>

3 个答案:

答案 0 :(得分:0)

&#13;
&#13;
#portfolio1Info h6 {
  margin-bottom: 0;
}
&#13;
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet" />
<div id="portfolio1" class="col-lg-4" style="border:solid">
  <div class="row">
    <div class="col-lg-12">
      <a href="www.placekitten.com" target="_blank">
        <img class="img-responsive" src="http://s.wordpress.com/mshots/v1/http%3A%2F%2Fwww.placekitten.com?" border="1" />
      </a>
    </div>
  </div>
  <div id="portfolio1Info" class="row">
    <div class="col-lg-12">
      <div style="background-color:#000000">
        <h5 align="center"> Please hold 1? </h5>
        <h6 align="center"><i> HTML? </i></h6>
      </div>
    </div>
  </div>
</div>
&#13;
&#13;
&#13;

如果您想将该页脚粘贴在底部,请删除H6标记后面的空格,默认情况下,h6有一些余量。

答案 1 :(得分:0)

它不是<h5>,而是第二行中的margin-top。它的_contentView.autoresizesSubviews = YES ; 为10px。

答案 2 :(得分:0)

试用此代码

         <style type="text/css">
            #portfolio1Info h5 ,#portfolio1Info h6 {
                margin-top: 0 !important;
            }
        </style>

效果很好