如标题中所述,我使用网站 FontAwesome 获取一个图标,然后尝试使用以下代码显示该图标:
<!DOCTYPE html>
<html>
<head>
<title>Loading....</title>
<link rel="stylesheet" href="./starting.css"></link>
</head>
<script src="https://kit.fontawesome.com/1f2023aaf1.js" crossorigin="anonymous"></script>
<body>
<i id="fa" class="fa fa-regular fa-spinner fa-xl"></i>"></i>
</body>
</html>
我尝试使用
fa-xl
使其变大,然后添加 fa
类。但这也不起作用。
我修复了你的 html 并删除了
fa-regular
<!DOCTYPE html>
<html>
<head>
<title>Loading....</title>
<link rel="stylesheet" href="./starting.css">
<script src="https://kit.fontawesome.com/1f2023aaf1.js" crossorigin="anonymous"></script>
</head>
<body>
<i id="fa" class="fa fa-spinner fa-xl"></i>
</body>
</html>
您正在添加一些额外的链接
<!DOCTYPE html>
<html>
<head>
<title>Loading....</title>
<link rel="stylesheet" href="./starting.css"></link>
<script src="https://kit.fontawesome.com/1f2023aaf1.js" crossorigin="anonymous"></script>
</head>
<body>
<i id="fa" class="fa fa-regular fa-spinner fa-xl"></i> <!-- this was modified -->
</body>
</html>