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