第一次使用 Font Awesome 发现相当的爽呀!它的图标很全,能够帮你节约时间去找图片。下面就来一起学习吧:
1: 去官方网站下载解压 http://fontawesome.io/
2: 解压后拷贝到你的项目中再引入到你的文件里面 如下:
"stylesheet" type="text/css" href="font-awesome-4.0.3/css/font-awesome.css" />
3: 开始使用:
注意: fa 是全局必须加入。
fa-trash-0 是你需要的图标类(相当于名字)参考地址: http://fontawesome.io/icons/。
fa-1g 控制大小用的 还有(fa-2x ,fa-3x,fa-4x,fa-5x)。
代码:
DOCTYPE html>
<html>
<head>
<title>font icons testtitle>
<meta charset="ut-8" />
<link rel="stylesheet" type="text/css" href="font-awesome-4.0.3/css/font-awesome.css" />
<style type="text/css" >
.danger{
display: inline-block;
width: 80px;
height: 30px;
text-align: center;
background: brown;
border-radius: 5px;
font-size: 14px;
line-height: 30px;
text-decoration: none;
color: white;
}
style>
head>
<body>
<a class="danger" href="#"><i class="fa fa-trash-o fa-lg">i>Deletea>
<i class="fa fa-trash-o fa-2x">i> Delete
<i class="fa fa-trash-o fa-3x">i> Delete
<i class="fa fa-trash-o fa-4x">i> Delete
<a href="#" class="fa fa-trash-o fa-5x">a>
body>
html>
来自:http://blog.csdn.net/lovoo/article/details/52819520