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([email protected]) 2x );
 

猜你喜欢

转载自www.cnblogs.com/chaoyong/p/9881343.html