我使用codeigniter和Font Awese5,我已经下载了最新版本的font Awese5,但是由于某些原因,我的图标没有显示出来
问题如何让图标显示在字体棒呆5我正在使用xampp
它应该会在登录文本旁边显示开发控制台中没有错误
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title><?php echo $title;?></title>
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/plugins/bs/css/bootstrap.css');?>">
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/css/stylesheet.css');?>">
<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/plugins/fa/web-fonts-with-css/fontawesome-all.min.css');?>">
<script type="text/javascript" src="<?php echo base_url('assets/js/jquery-3.2.1.slim.min.js');?>"></script>
<script type="text/javascript" src="<?php echo base_url('assets/js/popper.min.js');?>"></script>
<script type="text/javascript" src="<?php echo base_url('assets/plugins/bs/js/bootstrap.js');?>"></script>
</head>
<body>
<div class="row mb-3">
<div class="col-xl-12 col-lg-12 col-md-12 col-sm-12 col-xs-12">
<a href="<?php echo base_url('login');?>" class="btn btn-dark"><i class="fas fa-sign-in-alt"></i> Sign in</a>
</div>
</div>
</body>
</html>
发布于 2018-04-13 05:31:59
当涉及到哪些文件应该放在哪里时,font are站点上运行5.0.10的说明有点令人困惑。我遇到了这个问题,并通过以下步骤解决了它:
复制整个webfonts目录并将其粘贴到/static/styles/fontawesome中(这样它与css directory)
directory)
<link rel="stylesheet" href="static/styles/fontawesome/css/fontawesome-all.css">
<i class="fas fa-tachometer-alt"></i>
注意:如果您没有专业许可证,请确保仅使用免费设置中的图标。https://fontawesome.com/icons?d=gallery&m=free
这可能不适用于所有人,但希望它能帮助某些人解决这个令人沮丧的问题!
发布于 2018-02-23 13:05:23
你正在使用fas fa-sign-in-alt
,这是Font Awese5的专业版本,你需要获得许可证,然后只有你才能使用它们。你可以从here获取你的图标
发布于 2020-05-21 19:43:44
我知道这个帖子很老了。
我在fas fa-virus
的Font Awese5中也遇到了同样的问题。正如@zipzit提到的,在使用CDN时,完整性散列确实很重要。在这种情况下,最好的选择是注册Font Awesome,创建一个工具包,并将其添加到html
文件的<head>
标记中。这样,所有的免费图标("fa“、"fab”、"fas“、"far”、"fal")似乎都能正常工作。
示例
<script src="https://kit.fontawesome.com/xxxxxxx.js" crossorigin="anonymous"></script>
https://stackoverflow.com/questions/48941415
复制相似问题