Using srcset for responsive images - 1505050790

video_screenshot

视频发布时间

2014年9月25日

视频介绍

This 60 second video shows you how to use srcset, a new attribute that enhances the img attribute and allows you to provide different image files depending on the display resolution.

视频推介语

暂无,待补充。

译者信息

翻译

润稿

终审

原始链接

中文字幕

翻译流水号

加入字幕组

解说词中文版:

你能给用户的设备提供合适的图片吗

使用srcset属性 你可以为1x和2x指定显示不同的

图片文件

srcset属性使用逗号来分隔

一系列图片 文件描述包括

一个URL字符串 后面跟着一个图片标记 比如

1x或者2x

图片标记信息也用于

表示图片大小 以便能在合适的设备上显示

当你使用srcset时别忘记

使用src属性来指定fallback图片

以便低版本浏览器也能正常显示图片

现在开始使用srcset吧

Last updated

Was this helpful?