增加字体大小时,图标字体类不对齐

时间:2015-01-26 17:02:06

标签: css font-size glyphicons icon-fonts foundation-icon-fonts

我正在使用我在http://iconvau.lt/创建的图标字体,但是当我放置文本对齐中心时,图标不会居中。它留在左边。

html

<ul>
  <li class="col-md-2">
   <div class="icon-2"></div>
  </li>
</ul>

css:
       ul{ width: 200px; text-align: center; height: 200px;}
       li {background: #fff;}
      .icon-2:before {
           content: "\f104"; text-align: center; font-family: "iconvault";
           font-style: normal;
           font-weight: normal;
           font-variant: normal;
           text-transform: none;
           line-height: 1;
           -webkit-font-smoothing: antialiased;
           display: inline-block;
           text-decoration: inherit;
           color: #1b93b6;}

2 个答案:

答案 0 :(得分:1)

尝试将图标的边距设置为自动:

.icon-2 {
    margin: auto;
}

答案 1 :(得分:0)

我认为您应该将保证金设置为AUTO

    .icon-2 
    {
    margin: auto;
            }
相关问题