.img {
display: inline-block;
width: 18px;/*小图片的尺寸*/
height: 18px;/*小图片的尺寸*/
background:口#333 url(" images/ icons_ type . png") no repeat;/*雪碧图*/
background-position-x: 18px;/*核心思想:对小图进行定位*/
/*下面的样式用于居中*/
position: absolute;
left:50%;
top: 50%;
transform: translate( 50%, - 50%);/*简化的偏移操作*/
}
.parent{
/*display: inline-block;*/
width: 30px;/*小图的外框尺寸*/
height: 30px;
background-color: C #333;
position: relative;
}