.search em{
position: absolute;
top:8px;
right: 90px;
width: 20px;
height: 20px;
background: url(…/images/sprite-search.png) no-repeat;
}
.search em:hover{
background-position: -30px 0;
/* 精灵图第一个值是X轴的值 第二个值是Y轴的值,基本上都是负的多少多少 */
}
精灵图本质:
用一张大图包含所有小图,最关键的地方在于使用backgrond-postion属性精确定位