CSS Sprite
需要知道大图的网地,小图标在图上的位置偏移(写进css里的background-position要加负号),和大小。
<style>.icon {
background:url(background.png)
background-repeat:no-repeat
background-position:-25px -374px
height:16px
width:24px
}
</style>
<div class=".icon"></div>
img{-webkit-clip-path: polygon(0 0,100% 0,100% 40px,145px 40px,130px 60px,115px 40px,0 40px,0 0)
clip-path: polygon(0 0,100% 0,100% 40px,145px 40px,130px 60px,115px 40px,0 40px,0 0)
}