HTML5图片和源元素

时间:2016-01-27 14:56:37

标签: html5 image

我已经在HTML文件中写了这些行,以便在方向改变时更改图片。

<picture>
    <source media="all and (orientation: landscape)" srcset="images/images/images_of_teaching/futas_running_720w.jpg 720w, images/images/images_of_teaching/futas_running_1080w.jpg 1080w">
    <source media="all and (orientation: portrait)" srcset="images/images/images_of_teaching/iras_writing_720w.jpg 720w, images/images/images_of_teaching/iras_writing_1080w.jpg 1080w">
</picture>

但它不起作用。你能帮帮我吗?

谢谢

1 个答案:

答案 0 :(得分:2)

确保在图片标记内指定img标记:

wrap_parameters Product, include: Product.attribute_names + [:sku]