image-set()函数多倍图使用实例页面
展示
加载的图片是?
代码
-
HTML:
<h4>加载的图片是?</h4> <div class="image-set"></div>
-
CSS:
.image-set { width: 128px; height: 96px; background: url(./fallback.jpg); background: -webkit-image-set( url(w128.jpg) 1x, url(w256.jpg) 2x, url(w512.jpg) 3x); background: image-set( url(w128.jpg) 1x, url(w256.jpg) 2x, url(w512.jpg) 3x); background-size: cover; }