【问题标题】:How to use numbers on icons with font awesome in REACT?如何在 REACT 中字体很棒的图标上使用数字?
【发布时间】:2020-07-28 20:56:23
【问题描述】:

我希望输出如下图所示。

我在下面找到了罐子

<!-- Create an icon wrapped by the fa-stack class -->
<span class="fa-stack">
    <!-- The icon that will wrap the number -->
    <span class="fa fa-circle-o fa-stack-2x"></span>
    <!-- a strong element with the custom content, in this case a number -->
    <strong class="fa-stack-1x">
        2    
    </strong>
</span>

但此代码不在 REACT 中,我想使用 React-Fontawesome 在 REACT 中实现此代码

所以请帮我解决这个问题。

【问题讨论】:

    标签: reactjs font-awesome next.js react-font-awesome


    【解决方案1】:

    你可以这样做:

    <div style={{ position: "relative" }}>
        <FontAwesomeIcon icon="circle" />
        <span style={{ position: "absolute" }}>2</span>
    </div>
    

    【讨论】:

    • 我不想在上面放一个图标,我想调整一个数字。
    猜你喜欢
    • 2016-02-13
    • 2021-11-07
    • 2015-04-02
    • 1970-01-01
    • 1970-01-01
    • 2017-12-28
    • 2019-09-04
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多