June 2025
Beginner
817 pages
31h 30m
English
In the past, it wasn’t always easy to provide a suitable image for all display sizes. Frequently, quality or performance losses had to be accepted in this regard. The picture element enables you to find an HTML element that serves as a container element for multiple image sources. The individual image sources must be specified using the source element.
The following example demonstrates the use of these HTML elements:
... <h1>The picture element in use</h1> <p> <picture> <source media="(min-width: 1024px)" srcset="images/HK-1024.jpg"> <source media="(min-width: 640px)" srcset="images/HK-640.jpg"> <source media="(min-width: 480px)" srcset="images/HK-480.jpg"> <!-- Fallback for old browsers ...
Read now
Unlock full access