【问题标题】:can we fill color in toggle-off icon of font awesome?我们可以在字体真棒的关闭图标中填充颜色吗?
【发布时间】:2021-03-19 04:02:28
【问题描述】:

<i class="fa fa-toggle-off" style="color:red" ></i>

目前,我正在使用上述类和样式来关闭图标

我想如下图显示

我该怎么做?

提前致谢。

【问题讨论】:

    标签: html css bootstrap-4 font-awesome font-awesome-5


    【解决方案1】:
    <span style="color: red">
        <i class="fa fa-toggle-off"></i>
    </span>
    

    你需要使用这样的东西。

    【讨论】:

      【解决方案2】:

      使用那个图标你无法得到你想要的。 作为替代方案,您可以使用 fas fa-toggle-on 并将其旋转 180 度。 CodePen:https://codepen.io/kitchup/pen/yYeMXE

      //HTML
      <span class="toggle-off">
        <i class="fas fa-toggle-on"></i>  
      </span>
      
      //CSS
      .toggle-off{
        display: inline-block;
        font-size: 30px;
        color: red;
        transform: rotate(180deg);
      }
      

      【讨论】:

        猜你喜欢
        • 2017-02-19
        • 2016-05-21
        • 2019-09-09
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2016-09-19
        • 1970-01-01
        • 2014-07-09
        相关资源
        最近更新 更多