我的字体代码在HTML中不工作。我使用这个套件(<script src="https://kit.fontawesome.com/32b2571194.js" crossorigin="anonymous"></script>
)脚本链接在标题/正文标签后,但它仍然不工作,它只是向我展示了一个正方形!
你能解释一下这个问题吗?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Currency Website Template</title>
<link rel="stylesheet" href="/scss/style.css">
<script src="https://kit.fontawesome.com/32b2571194.js" crossorigin="anonymous"></script>
</head>
<body>
Light: <i class="fa-light fa-magnifying-glass-dollar"></i><br/>
Solid works:
<i class="fa-solid fa-magnifying-glass-dollar"></i>
</body>
</html>
除非你得到专业版,否则你不会得到它。
https://fontawesome.com/support why-are-some-highly-requested-icons-not-available-in-font-awesome-free
所以所有的fa-solid
应该工作良好,但不是其他版本。
这里是另一个库,使您的图标:https://icons8.com/line-awesome
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/line-awesome/1.3.0/line-awesome/css/line-awesome.min.css" integrity="sha512-vebUliqxrVkBy3gucMhClmyQP9On/HAWQdKDXRaAlb/FKuTbxkjPKUyqVOxAcGwFDka79eTF+YXwfke1h3/wfg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<i class="las la-search-dollar"></i>