Problem Statement
How can you make images responsive in HTML
Explanation
You can use the srcset and sizes attributes in the <img> tag to serve different image resolutions based on the device screen.
Code Solution
SolutionRead Only
<img src="small.jpg"
srcset="small.jpg 480w, medium.jpg 800w, large.jpg 1200w"
sizes="(max-width: 600px) 480px, 800px"
alt="Sample image">
Practice Sets
This question appears in the following practice sets: