精靈圖(sprites)
使用核心:
1.精靈技術主要針對於背景圖片的使用,就是把多個小背景圖片整合到一張大圖片中
2.移動背景圖片位置,可以使用background-position
3,移動的距離就是這個目標圖片的x、y坐標
4.一般情況都是往上往左移動,數值是負值
5.使用精靈圖時需要精確測量,每個小背景圖片的位置和大小
字體圖標的使用
一般推薦下面這2種
1.阿里矢量庫 https://www.iconfont.cn/
2.icomoon https://icomoon.io/app/#/select/library
溫馨提示: icomoon使用的時候,download中的fonts文件夾必須和當前html文件夾處於同一個根目錄下
css三角
css直接畫出網頁三角形
.box2 {
width: 0;
height: 0;
line-height: 0;
font-size: 0;
border: 50px solid transparent;
border-top-color: turquoise;
margin: 100px auto;
}
<!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.0">
<title>Document</title>
<style>
.box1 {
width: 0;
height: 0;
border-top: 10px solid greenyellow;
border-right: 10px solid hotpink;
border-bottom: 10px solid blue;
border-left: 10px solid red;
}
.jd {
float: right;
position: relative;
width: 120px;
height: 249px;
background-color: pink;
margin-top: 0;
}
.jd span {
position: absolute;
right: 15px;
top: -10px;
width: 0;
height: 0;
/* 為了照顧兼容性 */
line-height: 0;
font-size: 0;
border: 5px solid transparent;
border-bottom-color: pink;
}
</style>
</head>
<body>
<div class="jd">
<span></span>
</div>
<div class="box1">
</div>
</body>
</html>

