-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathindex.html
74 lines (65 loc) · 2.28 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<html>
<head>
<meta charset="utf-8"/>
<title>IconFont</title>
<link rel="stylesheet" href="css/demo.css">
<link rel="stylesheet" href="css/iconfont.css">
</head>
<body>
<div class="main">
<h1>IconFont 图标</h1>
<ul class="icon_lists clear">
<li>
<i class="icon iconfont"></i>
<div class="name">新浪</div>
<div class="code">&#xe600;</div>
</li>
<li>
<i class="icon iconfont"></i>
<div class="name">QQ</div>
<div class="code">&#xe601;</div>
</li>
<li>
<i class="icon iconfont"></i>
<div class="name">微信</div>
<div class="code">&#xe602;</div>
</li>
<li>
<i class="icon iconfont"></i>
<div class="name">facebook</div>
<div class="code">&#xe603;</div>
</li>
<li>
<i class="icon iconfont"></i>
<div class="name">twitter</div>
<div class="code">&#xe604;</div>
</li>
</ul>
<div class="helps">
第一步:使用font-face声明字体
<pre>
@font-face {font-family: 'iconfont';
src: url('iconfont.eot'); /* IE9*/
src: url('iconfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('iconfont.woff') format('woff'), /* chrome、firefox */
url('iconfont.ttf') format('truetype'), /* chrome、firefox、opera、Safari, Android, iOS 4.2+*/
url('iconfont.svg#uxiconfont') format('svg'); /* iOS 4.1- */
}
</pre>
第二步:定义使用iconfont的样式
<pre>
.iconfont{
font-family:"iconfont" !important;
font-size:16px;font-style:normal;
-webkit-font-smoothing: antialiased;
-webkit-text-stroke-width: 0.2px;
-moz-osx-font-smoothing: grayscale;}
</pre>
第三步:挑选相应图标并获取字体编码,应用于页面
<pre>
<i class="iconfont">&#x33</i>
</pre>
</div>
</div>
</body>
</html>