Hello,
First of all I would like to point out that I love your course, and that I really do appreciate the quality of content as well as the administrators readiness to help and solve our questions. This is an amazing community, and this world would be a better place if people were like this everywhere.
Ok, now to the point:
I’m struggling to understand the difference between the three different ways to make responsive images. If I understood correctly there are three ways to do this:
1.Resolution switching - different sizes.
I do not understand what we get here. In this example we have a live code with 2 content images. One is “Chris holding his daughter” (Which is art direction if I’m correct), and the other one called “Elva dressed as a fairy” should be resolution switching, different sizes.
However, when we narrow our browser viewport and open “Elva dressed as a fairy” with developer tools it always shows the same image with the same intrinsic size of 800x533px and same file size of 128kb, as well as the same content source of https://mdn.github.io/learning-area/html/multimedi…d-embedding/responsive-images/elva-fairy-800w.jpg.
The only thing that changes is the rendered aspect ratio and there could be hundreds of options depending on how big is the viewport.
Didn’t we provide only two options - 480 and 800?
Also, the image behaves completely the same as the one in the unresponsive example. It shrinks down as we shrink our browser viewport. I don’t get what we have achieved with all this code
img srcset=“elva-fairy-480w.jpg 480w,
elva-fairy-800w.jpg 800w”
sizes="(max-width: 600px) 480px,
800px"
src=“elva-fairy-800w.jpg”
alt=“Elva dressed as a fairy”
On the other hand, the other picture “Chris holding his daughter” offers two distinct content sources with different image sizes. When we narrow down our viewport our browser switches to the cropped version. I understand this.
2. Same size different resolutions.
If I understood correctly the point here is to offer several images depending on the resolution of the screen or the pixel density on the phones? So, I have a PC with a full HD resolution. When I open this example My browser renders the small 320x213 picture. Shouldn’t it load the biggest picture?
3. Art direction -
I think I understand this one - (basically providing a cropped version for narrower screens. So we have two different images as a resource)
Page of the article:
Responsive images - Learn web development | MDN (mozilla.org)
Sorry for the long post, I would like to fully understand your lesson, but it seems I can’t. I need your help.