精灵图 CSS sprite

 

精灵图  CSS sprite

一、优点

把一堆小的图片整合到一张大的图片上,减轻服务器对图片的请求数量

利用 css 的 "background-image","background-position"的组合进行背景定位

二、使用

1 {display: inline-block; /* inline 在一行 */
2 
3 background-image: url(../img/buyer/mod_circle.png);
4 background-position: center 5px;
5 /* position 背景定位 */
6 background-repeat: no-repeat;
7 /* repeat重复 no-repeat不重复*/
8 width: 80px;
9 height: 30px;}

 

posted @ 2021-10-25 20:29  .Nice  阅读(27)  评论(0)    收藏  举报