只有一些字体很棒的图标显示

发布于 2025-01-18 05:04:33 字数 944 浏览 4 评论 0 原文

只有某些图标有效:

  • fa-user
  • fa-check
  • fa-minus
  • fa-phone

其他仅显示一个空的方形图标:

  • fa-skull
  • fa-apple

和其他图标不执行任何操作:

  • fa-x
  • fa -xmark
  • fa-road-circle-exclamation

我正在将 Blazor 与 Blazorize 结合使用,并尝试了以下操作:

  • (有效)
  • (无效)
  • <图标名称="IconName.Mail" /> (有效)
  • <图标名称="@("fa-gift")" /> (有效)
  • (无效)
  • (不起作用)

在我的 _Host.cshtml 文件中,我有:

没有它, Blazorize 方法永远无法工作。

Only some icons work:

  • fa-user
  • fa-check
  • fa-minus
  • fa-phone

Others just show an empty square icon:

  • fa-skull
  • fa-apple

and others don't do anything:

  • fa-x
  • fa-xmark
  • fa-road-circle-exclamation

I'm using Blazor with Blazorize, and have tried the following:

  • <i class="fa fa-check"></i> (works)
  • <i class="fa-solid fa-xmark"></i> (doesn't work)
  • <Icon Name="IconName.Mail" /> (works)
  • <Icon Name="@("fa-gift")" /> (works)
  • <Icon Name="@("fa-xmark")" /> (doesn't work)
  • <Icon Name="@("fa-xmark")" IconStyle="IconStyle.Solid" /> (doesn't work)

In my _Host.cshtml file I have:

<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.15.4/css/all.css" />

Without which the Blazorize <Icon> method never works.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(4

演出会有结束 2025-01-25 05:04:33

解决方案 - 升级到字体很棒的6

图标,例如“ xmark”,不起作用,因为它们不包含在字体上很棒的版本5免费图标集中。这个问题专门询问版本5,包括一个链接。可能的解决方案是(1)不要使用缺少的图标或(2)升级到字体上很棒的6。

除了旁边,Bootstrap 5现在拥有自己的相当广泛的图标集,可以在此处找到:

bootstrap图标

Solution - Upgrade to Font Awesome 6

The icons, such as "xmark", do not work because they are not included in the Font Awesome version 5 free icon set. And the question specifically asks about version 5 by including a link. The possible solutions are (1) don't use missing icons or (2) upgrade to Font Awesome 6.

And as an aside, Bootstrap 5 now has its own quite extensive set of icons which can be found here:

Bootstrap Icons

记忆消瘦 2025-01-25 05:04:33

在版本 5 中使用“times”表示“xmark”和“x”

https ://fontawesome.com/v5/icons/times?s=solid&f=classic

Use "times" in version 5 for "xmark" and "x"

https://fontawesome.com/v5/icons/times?s=solid&f=classic

默嘫て 2025-01-25 05:04:33

我的快速解决方法是使用 fa-close 替换 fa-xmark

我正在使用 bootstrap 5,fa-xmark 不起作用,有时只有 fa-check 有效。

请参阅下面的示例,橙色图标和绿色图标

在此处输入图像描述

My quick work around is use fa-close to replace fa-xmark

I am using bootstrap 5, fa-xmark not working, only fa-check works sometimes.

see example my example below orange icon and green icon

enter image description here

鯉魚旗 2025-01-25 05:04:33

It seems that xmark icons are available only in 6.2.0 version which is paid. I have found a workaround: you can download .svg file of the icon you like and use it in your project with help of <img> tag. You will lose some fancy functionality like easy customization but it still works.

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