其实有一些常见的图标使用字体图标比使用img来得好

Font Awesome 官网:http://fortawesome.github.io/Font-Awesome/

字体代码:http://fortawesome.github.io/Font-Awesome/icons/ (点击图标可见)

使用方法:

最简单的使用,下载压缩包,把font文件夹复制到项目文件夹下,font-awesome.min.css放到CSS文件该放的地方,然后在html代码中link就可以了。

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<meta name="author" content=""> <title>font awesome</title> <link rel="stylesheet" href="css/font-awesome.min.css">
<link rel="stylesheet" href="css/font-awesome.css"> <link rel="stylesheet" type="text/css" href="css/my.css"> </head> <body role="document">
<div class="content">
<div class="wrapper">
<p>教育经历</p>
<p>Education</p>
</div>
<div class="article">
<h4 class="article-title">2012~2016</h4>
<dl>
<dd class="education-major">软件工程计算机应用方向(本科)</dd>
<dd class="education-honor">2012 - 2013 学年度校一等奖学金</dd>
<dd class="education-honor">2013 - 2014 学年度校二等奖学金</dd>
</dl>
</div> </body>
</html>
.wrapper::before {
font-family: FontAwesome;
font-size: inherit;
text-rendering: auto;
background-color: #333333;
color: white;
border-radius: 50px;
float: left;
width: 49px;
height: 49px;
text-align: center;
line-height: 49px;
font-size: 28px;
content: "\f02d";
} .article {
border-left: solid;
margin-top: -15px;
margin-left: 25px;
padding: 25px 25px 5px 25px ;
} .article::after {
font-family: FontAwesome;
font-size: inherit;
text-rendering: auto;
background-color: #333333;
color: #333333;
border-radius: 50px;
float: left;
padding:;
margin-left: -30px;
margin-bottom: 45px;
width: 9px;
height: 9px;
text-align: center;
font-size: 5px;
content: "";
} .article-title::before {
font-family: FontAwesome;
font-size: inherit;
text-rendering: auto;
background-color: #20B2AA;
color: white;
border-radius: 50px;
float: left;
width: 36px;
height: 36px;
margin-top: -10px;
margin-left: -5px;
text-align: center;
line-height: 36px;
font-size: 20px;
content: "\f061";
} .article-title {
/*overflow-x: hidden;*/
background-color: #333333;
border-radius: 6px;
color: white;
margin-left: -40px;
margin-top: -5px;
padding: 5px 0;
}

最后效果:

最新文章

  1. java基础1.0::Java面向对象、面向对象封装、抽象类、接口、static、final
  2. linux虚拟机安装
  3. Android自定义Activity酷炫的动画跳转效果
  4. BZOJ 2440: [中山市选2011]完全平方数( 二分答案 + 容斥原理 + 莫比乌斯函数 )
  5. wcf跨机器访问的问题
  6. Spring 集成 Dubbo
  7. mac使用小提示
  8. [LeetCode] 344 Reverse String &amp;&amp; 541 Reverse String II
  9. GLSL Versions和GLSL ES Versions 对比
  10. 第六节,Python的科学计算包——Numpy
  11. Linux基础学习笔记3-用户权限
  12. python学习记录
  13. jquery实现点击文字后变成文本框且可修改
  14. 【Python爬虫实战】 使用代理服务器
  15. 正则js
  16. 【拓扑 字符串还原 + 线段树维护】奇洛金卡达(father)
  17. Task 8 找水王
  18. ubuntu16.04 安装指定版本Node,升级npm到指定版本
  19. SQL case when 多条件查询
  20. [LeetCode系列] 跳跃问题II

热门文章

  1. 谷歌浏览器flash被禁用解决方法
  2. iBaties对比hibernate
  3. JS面向对象--你真的理解闭包了吗?
  4. python统计一个文本中重复行数的方法
  5. Mybatis insert返回主键ID
  6. 数据库迁移工具DBMigration
  7. Spring事务_注解_特性
  8. java-文件切割合并_对象的序列化
  9. day38 07-Spring框架Bean的时候方式
  10. Struts_添加客户练习