--- url: "https://web.dev/articles/codelab-art-direction" titulek: "Art direction | Articles | web.dev" h1: "Art direction Stay organized with collections Save and categorize content based on your preferences." popis: "In this codelab, learn how to load completely different images based on device display size." jazyk: "en" kanonicka: "https://web.dev/articles/codelab-art-direction" drobecky: ["Articles", "Art direction"] zdroj: "live" wayback_snapshot: "" stazeno: "2026-09-13 22:28:59" znaku: 2382 slov: 323 kodovani: "iso-8859-2" sha256: "554c49507cae12223d6aee42246be6b7f4598c0dc43c9878b22b670bd3ecae47" --- Art direction Stay organized with collections Save and categorize content based on your preferences. Katie Hempenius Try out this demo To preview the site, press **View App**. Then press **Fullscreen** . Reload the app using different browser sizes. Notice how different the images are: they're not only different sizes but also different croppings and aspect ratios. What's going on here? [Art direction](https://developer.mozilla.org/docs/Learn/HTML/Multimedia_and_embedding/Responsive_images#Art_direction) shows different images on different display sizes. A responsive image loads different sizes of the same image. Art direction takes this a step further and loads completely different images depending on the display. Use art direction to improve visual presentation. For example, the different image croppings in this demo ensure that the point of interest (the flower) is always shown in detail, regardless of the display. Art direction's benefits are purely aesthetic; it provides no performance benefit over responsive images. View the code View `index.html` to see the art direction code for this demo. How the code works Art direction uses the [``](https://developer.mozilla.org/docs/Web/HTML/Element/picture), [``](https://developer.mozilla.org/docs/Web/HTML/Element/source), and `` tags. **picture** The `` tag provides a wrapper for zero or more `` tags and one `` tag. **source** The `` tag specifies a media resource. The browser uses the first `` tag with a [media query](https://developer.mozilla.org/docs/Web/CSS/Media_Queries/Using_media_queries) that returns true. If none of the media queries match, the browser falls back to loading the image specified by the ``. tag. **img** The `` tag makes this code work on browsers that don't support the `` tag. If a browser does not support the `` tag, it loads the image specified by the `` tag. Except as otherwise noted, the content of this page is licensed under the [Creative Commons Attribution 4.0 License](https://creativecommons.org/licenses/by/4.0/), and code samples are licensed under the [Apache 2.0 License](https://www.apache.org/licenses/LICENSE-2.0). For details, see the [Google Developers Site Policies](https://developers.google.com/site-policies). Java is a registered trademark of Oracle and/or its affiliates. Last updated 2018-11-05 UTC.