font-awesome 图标没法显示

font-awesome 图标没法显示,若是你的相对位置没问题,那么多是 :你项目里的样式的字体定义的问题。css

由于 font-awesome自己就是字体图标,你能够打开它的css文件就能够看出:html

@font-face{ font-family:'FontAwesome'bootstrap

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>demo</title>
<!--<link href="//netdna.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">-->
<style>
* {	margin:0; padding:0; font-family: "Microsoft YaHei" !important;  /*注意看这里,由于这里的全局样式字体样式定义为了微软雅黑,因此致使下面的awesome字体没法显示。*/}
</style>
<link href="css/font-awesome.min.css" rel="stylesheet" type="text/css" />
</head>

<body>
<i class="fa fa-camera-retro" style="font-size:40px; color:#F33;">2222</i>
</body>
</html>

全局定义没有问题,【解决办法:只要去掉后面的 !important 便可。】字体

相关文章
相关标签/搜索