字体图标
比较适合用于简单的样式,颜色单一
字体图标上传:
上传SVG图,上传时注意去掉颜色
字体图标使用:
先下载再使用 :iconfont
1.先加到购物车
2.添加到项目
3.下载
4.引入 样式表
5.调用图标对应类名,必须调用两个类名
<link rel="stylesheet" href="./iconfont.css">
<link> 标签定义文档与外部资源的关系。
<link> 标签最常见的用途是链接样式表。
案例:淘宝购物车
补充:HTML学习之路-06盒子模型_html盒子_『Knight』的博客-优快云博客
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=】, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./download/iconfont/iconfont.css">
<style>
/* 清除标签内外边距 */
* {
margin: 0;
padding: 0;
}
/* 清除小圆点 */
li {
list-style: none;
}
/* 清除A的颜色和下划线 */
a {
color: #333;
text-decoration: none;
}
.nav {
width: 200px;
/* 盒子水平居中 */
margin: 50px auto;
font-size: 12px;
}
.icon-gouwuche {
color: orangered;
}
.icon-31xiala {
font-weight: bold;
}
</style>
</head>
<body>
<div class="nav">
<ul>
<li>
<a href="#">
<span class="iconfont icon-gouwuche"></span>
<span><b>购物车</b></span>
<span class="iconfont icon-31xiala"></span>
</a>
</li>
</ul>
</div>
</body>
</html>
平面转换
使用transform属性实现位移,旋转,缩放等效果
位移
transform:translate(水平移动距离,垂直移动距离)