css image-set 讓瀏覽器自動切換1x,2x圖片

方法一:

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

 

方法二:spa

background-image: url(img.jpg');
background-image: image-set( url(img.jpg) 1x, url(img@2x.jpg) 2x );  
相關文章
相關標籤/搜索