css image-set 让浏览器自动切换1x,2x图片

方法一:

<img src="img.png" srcset="path/img.png 2x,path/img.png.png 3x"/>

 

方法二:

background-image: url(img.jpg');
background-image:image-set( url(img.jpg) 1x, url(img@2x.jpg) 2x );

 

 
posted @ 2018-10-31 10:03  一轮明月随潮涌  阅读(1641)  评论(0编辑  收藏  举报