2013-09-27 64 views
0

我正在面对新引导版本3的问题。 为什么新版本中某些元素之间的垂直边缘会丢失? 我从v2.3迁移,现在很多事情都出错了。Bootstrap v3中元素之间的垂直边距会丢失?

在下面的示例中,面板和表格之间没有保证金 这在v2中正常工作。在v3中有没有解决这个问题的方法?

<div class="container">  
    <form class="form-inline" role="form"> 
     <div class="form-group"> 
     <input class="form-control" id="search" name="search" placeHolder="Search" type="text" /> 
     </div> 
     <input type="submit" class="btn btn-primary" value="Search" /> 
    </form> 

    <div class="panel panel-default"> 
     <div class="panel-heading">Panel heading</div> 
     <table class="table table-condensed table-hover"> 
      <thead> 
      <tr> 
       <th>Item No</th> 
      </tr> 
      </thead> 
      <tbody> 
       <tr> 
        <td>1000</td> 
       </tr> 
      </tbody> 
     </table> 
    </div> 
</div> 

结果:

enter image description here

回答

1

我不知道为什么你可以解决这个问题:

.form-inline+.panel { 
    margin-top: 10px; 
} 
+0

是的,这个解决方案的工作,但我真的想知道为什么这些利润在新版本中丢失了。 – GuFigueiredo

+0

顺便说一下,我在'.form-inline'中看不到任何底部边距,或者在v2.3中输入了儿童,而在“补丁说明”中没有任何内容。查看http://getbootstrap.com/getting-started/#migration –

相关问题