gpt4 book ai didi

css - Font Awesome 显示为正方形

转载 作者:行者123 更新时间:2023-11-28 04:49:51 24 4
gpt4 key购买 nike

我正在尝试让 Font-Awesome (v4.7) 正常工作,但它只显示为正方形。我的网站根目录中有字体文件夹,CSS 文件位于名为 style 的文件夹中。我已将字体添加到字体目录中,并确认 font-awesome.css 文件@font-face 的 url 为“../fonts/”。我假设 CSS 使用了该引用,因此如果 CSS 位于根目录的子文件夹中,然后字体位于根目录/字体文件夹中,那么它是正确的。

bootstrap glyphicons 工作,bootstrap 字体与 font-awesome 字体位于同一目录中。

<span class="fa fa-refresh">FA</span>
<span class="glyphicon glyphicon-cloud">glyph</span>

如果我查看开发工具,我没有看到任何错误,而且我可以看到 font-awesome 标签,就像它应该的那样。

有人有什么建议吗?

enter image description here

主页。我不知道为什么所有的过期都在那里,我继承了这个网站,但我认为这不是问题的一部分。

<head runat="server">
<title>Preferential Bidding System</title>
<meta http-equiv="cache-control" content="max-age=0" />
<meta http-equiv="cache-control" content="no-cache" />
<meta http-equiv="expires" content="0" />
<meta http-equiv="expires" content="Mon, 01 Jan 1900 1:00:00 GMT" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link href="style/bootstrap.css" rel="stylesheet" />
<link href="style/font-awesome.css" rel="stylesheet" type='text/css' />
<link href="style/layout.css" rel="stylesheet" type='text/css' />

<script src="js/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.10.1.custom.min.js" type="text/javascript"></script>

<asp:ContentPlaceHolder ID="head" runat="server">
</asp:ContentPlaceHolder>
</head>

最佳答案

首先尝试使用 Font Awesome 页面中描述的语法(意思是 <i> 而不是 <span> ):

<i class="fa fa-address-book" aria-hidden="true"></i>

如果这对继续阅读没有帮助:

在过去的 2-3 年里,我曾多次遇到这种情况,而且总是以下情况之一:

a) 错误的相对/绝对路径=> 最近我只是在使用 Font Awesome CDN , 这使得这不是问题

b) 我的代码中的拼写错误 - 有时很容易错过明显的地方

查看您的代码,我倾向于 a) 并且我会建议您尝试 CDN,即使在这种情况下有理由不使用它 - 但它会帮助您轻松测试您的网络是否存在问题小路。

旁注:您是否有机会使用 Less 预先编译一些额外的 CSS?可能与旧版本的 Font Awesome 混淆,它在某处存储和引用(并且它可能缺少图标,例如仅 v4.7)

关于css - Font Awesome 显示为正方形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40774234/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com