1

HTML5 allows the inclusion of the srcset and sizes attributes on images. I haven’t read anything about how a browser will react if an image has both a width attribute and a sizes attribute.

My guess is that sizes (provided that there is a srcset to go with it) should take precedence. Can anybody tell me where the official word is on that?

Thanks

4

1 回答 1

1

sizes属性srcset会影响选择的资源,它会影响图像的固有像素密度,因此会影响图像的渲染大小,但前提是您没有使用 CSS 或width/height属性指定其尺寸。

于 2015-09-21T07:49:53.060 回答