这个网站是如何在带有display:table的元素上添加2px边距的?

时间:2015-11-13 12:43:20

标签: html css twitter-bootstrap tablecell

关于另一篇有类似问题的帖子:2px margin between the th elements,我也有这个问题,但仍然无法用写在那里的代码修复它,因为它有点不同。我有几个带有引导程序的div。我想垂直和水平居中文本,所以我添加了以下CSS,任何想法?感谢。

CSS:

.tabs_titles {
    display: table-cell;
    vertical-align: middle;
    text-align: center;
    font-family: opensans, sans-serif;
    font-weight: 100;
    font-size: 4em;
    padding: 10px;
}

.catalog,
.latest_collections,
.contact_tab,
.section_slider {
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 0 0;
    padding: 0 30px;
    min-height:450px; 
    display: table;
    overflow: hidden;
}

HTML:

<section class="clearfix">

  <div class="catalog col-md-6 col-sm-6 col-xs-12">
      <h2 class="tabs_titles"></h2>
  </div> <!-- end catalog -->
  <div class="other_services col-md-6 col-sm-6 col-xs-12">
      <div class="contact_tab col-md-6 col-sm-6 col-xs-12">
          <h2 class="tabs_titles"></h2>
      </div>
      <div class="latest_collections col-md-6 col-sm-6 col-xs-12">
          <h2 class="tabs_titles">צפו בקולקציות הכי חמות שלנו</h2>
      </div>
      <div class="section_slider">
          <h2 class="tabs_titles"></h2>
      </div>
  </div> <!-- end other_services -->

  </section>

0 个答案:

没有答案