【问题标题】:Icon doesn't have the correct size (Font Awesome)图标的大小不正确(Font Awesome)
【发布时间】:2014-01-11 19:18:31
【问题描述】:

我刚刚开始使用 Font Awesome 为我即将推出的主页。

现在我尝试实现一些社交网络。到目前为止,它对 facebook und Co. 非常有效,但是我在一个名为 XING 的网络上遇到了问题。

这是我用于 LinkedIN 的代码:

<div class="i_iconsoc"><a href="#"><i class="fa fa-linkedin"></i></a></div>

这就是我用于 XING 的:

<div class="i_iconsoc"><a href="#"><i class="fa fa-xing"></i></a></div>

在我看来,两者看起来都一样,但不知何故,它会显示如下: http://i.stack.imgur.com/81WN9.png

你能帮我解决这个问题吗?这是我在 CSS 文件中的代码。

     .fa-xing
 {
     background:#68d49a;
     -webkit-transition: all 0.5s ease;
    -moz-transition: all 0.5s ease-in-out;
    -o-transition: all 0.5s ease-in-out;
    -ms-transition: all 0.5s ease-in-out;
    transition: all 0.5s ease-in-out;
     }

【问题讨论】:

    标签: html css fonts icons font-awesome


    【解决方案1】:

    ul {
      margin: 0;
      padding: 0;
      }
    ul li {
      list-style: none;
      float: left;
      margin-left: 5px;
      }
    ul li a {
      text-decoration: none;
      padding: 8px 12px;
      color: #FFF;
      background: #545454;
      font-size: 25px;
      border-radius: 50%;
      transition: color 0.3s ease-in-out;
      -webkit-transition: color 0.3s ease-in-out;
      }
    ul li a:hover {
      color: #C86565;
      }
    
    .fa-color1 {
      color: #0095FF;
      margin-left: 4px;
      transition: color 0.3s ease-in-out;
      -webkit-transition: color 0.3s ease-in-out;
      }
    .fa-color1:hover {
      color: #6BC5EB;
      }
    <head>
    <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <title>font</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <!-- Bootstrap  -->
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-T8Gy5hrqNKT+hzMclPo118YTQO6cYprQmhrYwIiQ/3axmI1hQomh7Ud2hPOy8SP1" crossorigin="anonymous">
    
    
    <link href="https://fonts.googleapis.com/css?family=Squada+One" rel="stylesheet">
    </head>
    
    <body>
     <ul>
       <li><a href="#"><i class="fa fa-facebook"></i></a></li>
       <li><a href="#"><i class="fa fa-twitter"></i></a></li>
       <li><a href="#"><i class="fa fa-github"></i></a></li>
       </ul>
      
      <br><br><br>
    
      <a href="#"><i class="fa fa-facebook fa-2x fa-color1"></i></a>
      <a href="#"><i class="fa fa-twitter fa-3x fa-color1"></i></a>
      <a href="#"><i class="fa fa-github fa-4x fa-color1"></i></a>
     </body>

    【讨论】:

      【解决方案2】:

      icon 字体有一个属性叫做:.fa 哪里可以放 icon 使用的 font-size,会尝试修改那个属性

      .fa {
        display: inline-block;
        font-family: FontAwesome;
        font-style: normal;
        font-weight: normal;
        line-height: 1;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
      }
      

      我建议使用 fontello,包括所有 font-awesome 和其他字体,如果你使用它会这样做:

      .youritem.icon-linkedin:before{
      content: '\e808';
      //your font-size
      font-size: 23px;
      }
      

      【讨论】:

      • 谢谢 - 我终于找到了... .fa-twitter,.fa-xing, .fa-linkedin{padding:11px;} .fa-facebook --> 是原因!跨度>
      • 哦!是真的,我等着我的回答对你有帮助,所以...不要忘记重置页边距,也许
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-07-04
      • 1970-01-01
      • 2020-01-08
      • 2022-01-18
      • 2019-12-31
      • 2021-05-04
      • 1970-01-01
      相关资源
      最近更新 更多