HTML4 HTML5
Used for flexible serving of responsive images[cite: 3]. This container allows defining multiple image sources (<source> tags) depending on screen resolution, browser window width, or supported file formats, ending with a default <img> tag[cite: 3].
Both opening and closing tags are mandatory[cite: 3].
Attributes:
class, id, and style are used[cite: 3].Code:
The browser will interpret this code as follows: