神刀安全网

Safari 9.1

Picture Element Support

You can use the HTML picture element to provide Safari with multiple versions of the image for different browser configurations and viewport sizes. Safari evaluates the picture’s image resources in the order in which they are provided. Safari displays the first image resource with media attributes that conform to the browser’s user agent and device specifications. Include an img element, like the one shown in Listing 1 , as fallback for browsers without picture element support. For more information, see http://www.w3.org/html/wg/drafts/html/master/semantics.html#the-picture-element .

Listing 1A picture element with multiple sources

<picture>
<source media="(min-width: 1000px)" srcset="picture_large.jpg">
<source media="(min-width: 500px)" srcset="picture_small.jpg">
<img src="picture_default.jpg">
</picture>

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Safari 9.1

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
分享按钮