← TechnologyThe essentials of

Responsive images: choosing a source with srcset and picture

Publisher: ResumeMaker • 2 sources

Published: 22 Oct 2026 13:13 · Updated: 22 Oct 2026 13:13

AI source check: 20 Oct 2026 21:15. This is not editorial approval.

In a few sentences

In brief

HTML can offer different sizes and compositions of an image. This helps the site to match the display to the screen without relying only on visual shrinkage.

Useful to know

A photo can stand excellently on a wide monitor and lose its important details in a narrow phone view. A simple reduction in width does not solve every problem. MDN distinguishes the need for appropriate resolution and the need for different artistic framing. [1] The first is related to the amount of pixel information, and the second - to what part of the scene should be shown at all. The distinction is useful even before the export of the files for the site begins.

If the image is displayed in a small area, it is not always necessary to transfer the largest available original. HTML offers mechanisms such as srcset and sizes to describe variants and display conditions. [1] This is a different idea from a single large file that CSS only visually shrinks. For the browser, there should be enough information as to what candidates exist. Then he can choose a suitable resource according to the conditions, instead of the site unconditionally sending the same version to each visitor.

The picture element contains alternative source elements and one img element. The browser examines the conditions and selects a suitable candidate, and img also provides a backup option. [2] Thus, the structure has both a choice and a basis for display. It can be used when different screens require different images or when different formats are available. However, it is necessary that all variants serve the same meaning task, and not accidentally show unrelated scenes under one inscription.

Attributes such as media, type and srcset. may be involved in the selection. MDN points to artistic framing as one of the main uses of picture. [2] This helps, for example, with a broad group shot in which faces become indistinguishable after shrinking. A narrower shot can save the essential information for the mobile view. It is important that the choice is conscious. Automatic cutting off of the random end of the picture can remove exactly the object for which it is included in the material.

For a learning example, we can take a photograph of a building with an important entrance. On a wide screen, the general plan explains the context, and on a small width, the closer frame can emphasize the input. However, if the article analyzes the silhouette, the same cut may be inappropriate. The right decision follows the theme of the material. Thus, adaptability is not reduced to technical saving of bytes, but also includes an editorial judgment of what the reader should understand from the image in any environment.

The check must view the selected file, the real size and the visible content at the same time. It is useful to try different screen widths and densities, not just one manual narrowing of the window. It is then checked whether the backup version remains meaningful and whether the text description matches all the proposed frames. Well-prepared images make a page more predictable for different devices when technical options are associated with a clear visual purpose and measuring the resource actually delivered.

Sources

For further detail and to check the information:

  1. [1] MDN — Responsive images ↗
  2. [2] MDN — picture element ↗