0

我希望输出如下图所示。

在此处输入图像描述

我在下面找到了罐子

<!-- 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 中使用React-Fontawesome来实现它

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

4

1 回答 1

0

你可以这样做:

<div style={{ position: "relative" }}>
    <FontAwesomeIcon icon="circle" />
    <span style={{ position: "absolute" }}>2</span>
</div>
于 2020-04-15T18:55:54.490 回答