导航精灵图设置
精灵图使用步骤:
-
创建一个盒子
-
设置盒子大小为小图片大小
-
设置精灵图为盒子的背景图片
-
将小图片左上角坐标 取负值,设置给盒子的background-position:x y
/* 手机精灵图 */
.xtx-shortcut li:last-child a::before {
display: inline-block;
content: '';
width: 11px;
height: 16px;
margin-right: 8px;
margin-top: -3px;
background-color: pink;
background: url(../images/sprites.png) -160px -70px;
vertical-align: middle;
}