字体真棒图标未显示,仅显示框
我尝试使用 font Awesome 中的图标,但它不起作用,我复制了脚本链接并将其粘贴到 head 标签,但它只显示一个框。
注意:我添加了实际的套件编号,只是将其隐藏在这里。您可以检查图像。 屏幕截图
<head>
<title>Page Title</title>
<script src="https://kit.fontawesome.com/my-kit-number.js" crossorigin="anonymous">
.
</script>
</head>
<body>
<i class="fa-solid fa-microphone"></i>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
I tried to use an icon from font awesome but it’s not working, i copied the script link and pasted it to the head tag but it’s just showing a box.
Note: I added the actual kit number, I’m just hiding it here. You can check the image.
Screenshot
<head>
<title>Page Title</title>
<script src="https://kit.fontawesome.com/my-kit-number.js" crossorigin="anonymous">
.
</script>
</head>
<body>
<i class="fa-solid fa-microphone"></i>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
</body>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
工作示例图像
对“my-kit-number”的引用是错误的,您需要转到此处: https://fontawesome.com/start 并添加电子邮件,以便您可以收到有效的脚本源替换'my-kit-number' 为有效 ID
working example image
the reference to 'my-kit-number' is wrong you need to go here: https://fontawesome.com/start and add an email so then you can receive a valid script source replacing 'my-kit-number' for a valid id
必须使用
.fa
或.fas
。无需工具包,此示例使用免费 CDN。The either
.fa
or.fas
must be used. No need for a kit this example is using a free CDN.