我正在开发的页面中使用Font Awesome图标,虽然fas
图标工作正常,但fab
图标却没有。相反,使用fab
图标,我得到一个空白方块。我目前同时拥有Font Awesome CDN链接和本地fontawesome-all.min.css
文件的链接。我已禁用AdBlock Plus,我使用http-server
作为我的开发服务器。这是我页面的头部和第一部分的副本。
<!DOCTYPE html>
<html lang="en-us">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Download</title>
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/styles.css">
<link href="https://fonts.googleapis.com/css?family=Simonetta" rel="stylesheet">
<link rel="stylesheet" href="/css/fontawesome-all.min.css">
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/solid.js" integrity="sha384-+Ga2s7YBbhOD6nie0DzrZpJes+b2K1xkpKxTFFcx59QmVPaSA8c7pycsNaFwUK6l" crossorigin="anonymous"></script>
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/fontawesome.js" integrity="sha384-7ox8Q2yzO/uWircfojVuCQOZl+ZZBg2D2J5nkpLqzH1HY0C1dHlTKIbpRz/LG23c" crossorigin="anonymous"></script>
</head>
<body>
<!-- banner section -->
<section id="banner" class="bg-success">
<div class="container">
<div class="row max-viewport align-items-center text-center">
<div class="col-md-6 my-5 order-2 order-md-1">
<img src="images/banner.png" alt="banner" class="img-fluid">
</div>
<div class="col-md-6 my-5 order-1 order-md-2">
<h1 class="text-danger text-uppercase">
<small>phone crasher</small> App
</h1>
<p class="lead text-white">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
<a href="#" class="btn btn-outline-dark text-uppercase m-2"><i class="fab fa-apple mr-2"></i>Apple Store</a>
<a href="#" class="btn btn-outline-dark text-uppercase m-2"><i class="fab fa-google mr-2"></i>Google Store</a>
</div>
</div>
</div>
</section>`
答案 0 :(得分:1)
看起来您缺少brands.js文件的导入
<script defer src="https://use.fontawesome.com/releases/v5.0.8/js/brands.js" integrity="sha384-sCI3dTBIJuqT6AwL++zH7qL8ZdKaHpxU43dDt9SyOzimtQ9eyRhkG3B7KMl6AO19" crossorigin="anonymous"></script>
请阅读他们的docs(提示:点击&#34;品牌&#34;药丸以包含它)
答案 1 :(得分:0)
不要添加两次有时会导致问题。 并使用此
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/solid.css" integrity="sha384-v2Tw72dyUXeU3y4aM2Y0tBJQkGfplr39mxZqlTBDUZAb9BGoC40+rdFCG0m10lXk" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.0.8/css/fontawesome.css" integrity="sha384-q3jl8XQu1OpdLgGFvNRnPdj5VIlCvgsDQTQB6owSOHWlAurxul7f+JpUOVdAiJ5P" crossorigin="anonymous">