我正在尝试实现艺术方向,并使<picture>元素在移动设备上显示正方形图像,在所有其他设备上显示风景图像。由于某些原因,当Safari应该能够识别我在这里给出的<source srcset="">值时,它总是退回到<img>标记。
<picture>
<source media="(max-width: 480px)" srcset="http://placehold.it/480x480">
<source media="(max-width: 640px)" srcset="http://placehold.it/640x320">
<source media="(max-width: 1024px)" srcset="http://placehold.it/1024x600">
<img src="http://placehold.it/1224x1224/c00/fff" alt="">
</picture>这似乎可以在chrome中找到,但是谁能解释一下为什么Safari忽略这些srcset属性,以及我如何让它在Safari9中工作?谢谢!
发布于 2016-01-13 02:01:14
Safari9不支持<picture>,但看起来Safari9.1支持!https://developer.apple.com/library/archive/releasenotes/General/WhatsNewInSafari/Articles/Safari_9_1.html?ref=webdesignernews.com
发布于 2015-11-26 00:09:06
Safari9不支持<picture>。它只支持<img srcset>。如果您需要Safari的<picture>支持,您可能想要向您的站点添加picturefill。
https://stackoverflow.com/questions/33906441
复制相似问题