React Font Awesome - 图标代码 \f00d 不显示

发布于 2025-01-17 15:07:57 字数 443 浏览 2 评论 0原文

我正在尝试将图标添加到已经使用图标的现有项目中。我需要这个特定的代码“ \ 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

喜你已久 2025-01-24 15:07:57

看来您正在使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文