Web Platform Atlas
EN⚡RUUA⚡DE⚡FR⚡ES⚡PL⚡PT⚡ZH⚡JA⚡
Каталог / HTML / The picture element

4.8.1 The picture element

Статический предпросмотр (RU): для MDN, WPT, глоссария и BYOK-перевода откройте интерактивный Атлас.
⚡ Открыть главу в Атласе

4.8.1 The picture element

Категории:

потоковое содержимое.

Фразовое содержимое.

Embedded content.

Palpable content.

Контексты, в которых может использоваться этот элемент:

Where embedded content is expected.

Контентная модель:

Zero or more source elements, followed by one img element, optionally intermixed with script-supporting elements.

Опущение тегов в text/html:

Ни один из тегов не может быть опущен.

Атрибуты контента:

глобальные атрибуты

Специфика доступности:

Для авторов.

Для разработчиков.

Санитизация:

Uncategorized.

DOM-интерфейс:

[Exposed=Window] interface HTMLPictureElement : HTMLElement { [HTMLConstructor] constructor(); };

The picture element is a container which provides multiple sources to its contained img element to allow authors to declaratively control or give hints to the user agent about which image resource to use, based on the screen pixel density, viewport size, image format, and other factors. It represents its children.

The picture element is somewhat different from the similar-looking video and audio elements. While all of them contain source elements, the source element's src attribute has no meaning when the element is nested within a picture element, and the resource selection algorithm is different. Also, the picture element itself does not display anything; it merely provides a context for its contained img element that enables it to choose from multiple URLs.