Element picture

<picture>
 <source media="(max-width: 640px)" srcset="https://tenman.info/labo/css/files/hasu-sensyu-park-300x223.jpg">
 <img src="https://tenman.info/labo/css/files/hasu-sensyu-park.jpg" /> 
</picture>

The HTML <picture> element is a container used to specify multiples for a specific <img> contained in it. The browser will choose the most suitable source according to the current layout of the page (the constraints of the box the image will appear in) and the device it will be displayed on (e.g. a normal or hiDPI device).


新着記事

コメントは受け付けていません。