React Font Awesome - 图标代码 \f00d 不显示
我正在尝试将图标添加到已经使用图标的现有项目中。我需要这个特定的代码“ \ f00d”。我可以在node_modules/font-awose/css/font-awesome.css
中看到它:
.fa-remove:fa close:.fa-close:.fa-close:.fa-close:.fa-times,.fa-times: {content:“ \ f00d”之前; }
但是它与任何这些插曲都无法使用(其他图标工作,例如.fa-window-close:{content:“ \ f2d3”;}
之前,
这就是我的方式我正在使用它:
&lt; i className =“ fas fa-close” onclick = {onclose} /&gt; < /code>
I am trying to add an icon to an existing project who already used icons. I need this particular one with the code '\f00d'. I can see it in node_modules/font-awesome/css/font-awesome.css
as following:
.fa-remove:before, .fa-close:before, .fa-times:before { content: "\f00d"; }
However it is not working with any of those clases ( other icons work, like .fa-window-close:before { content: "\f2d3"; }
)
This is how I am using it:
<i className="fas fa-close" onClick={onClose} />
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来您正在使用 Font Awesome v.5.0 或更低版本,在此版本中 fa-times 常规仅在 FA5 Pro 中可用。我强烈建议您将 Font Awesome 包升级到 v.6,并遵循他们在 React 项目中使用 Font Awesome 的指南。 Font Awesome React 文档。您可以在那里使用 https://fontawesome.com/icons/xmark?s=solid。但普通版仍然仅适用于专业版用户。
It appears you are using Font Awesome v.5.0 or lower, in this version fa-times regular is only available in FA5 Pro. I would urge you to upgrade your Font Awesome package to v.6 and following their guidlines for using Font Awesome in React projects. Font Awesome React Docs. There you could use, https://fontawesome.com/icons/xmark?s=solid. But regular is still only available to Pro users.