Hello, I’m currently doing the “Mozilla Splash page” assessment. I can get everything to work except for the part with the responsive images. Here’s a snippet of my HTML doc:
One reason that might be causing a problem is that if you are using a very hi res screen, the browser might load up the larger image even at the narrow width, so that it start looks sharp, and not fuzzy.
I am doing a Mozilla splash page assignment and it seems like scrset/sizes works well in Firefox browser: 120px icons are downloaded when the screen width is 480px or lower, and 400px icons otherwise.
But in Google Chrome dev tools it keeps downloading 400px icons no matter how small the screen width is. At least that is what I see on a Network tab.
I tried to check finished assignment on MDN Github and there is the same issue.
Is this about Google Chrome not supporting this attributes or something else?
Thank you!
P.S. Red panda image changes work just fine
P.S.S. Nevermind, I just checked StackOverflow. It seems like a Chrome feature. It recognizes that my resolution is higher than I want it to think. Funny moment, its own tool can’t fool the browser =) Even after clearing and disabling cache it keeps getting 400px images.
Wrapping in the <picture> element still works, though
<body>
<header>
<h1>Mozilla</h1>
<!-- insert <img> element, link to the small
version of the Firefox logo -->
<img src="firefox_logo-only_RGB_400.png" alt="Firefox Logo">
</header>
<main>
<article>
<!-- insert iframe from youtube -->
<iframe width="560" height="315" src="https://www.youtube.com/embed/p85rO57cWKM" frameborder="0" allowfullscreen></iframe>
<h2>Rocking the free web</h2>
<p>Mozilla are a global community of technologists, thinkers, and builders, working together to keep the Internet alive and accessible, so people worldwide can be informed contributors and creators of the Web. We believe this act of human collaboration across an open platform is essential to individual growth and our collective future.</p>
<p>Click on the images below to find more information about the cool stuff Mozilla does. <a href="https://www.flickr.com/photos/mathiasappel/21675551065/">Red panda picture</a> by Mathias Appel.</p>
</article>
<div class="further-info">
<!-- insert images with srcsets and sizes -->
<a href="https://www.mozilla.org/en-US/firefox/new/">
<img srcset="firefox_logo-only_RGB_Original.png 1200w,
firefox_logo-only_RGB_400.png 400w,
firefox_logo-only_RGB_120.png 120w"
sizes="(max-width: 480px) 120px,
400px"
src="firefox_logo-only_RGB_Original.png"
alt="Firefox Logo"
>
</a>
<a href="https://www.mozilla.org/">
<img
srcset="mozilla-dinosaur-head_Original.png 1200w,
mozilla-dinosaur-head_400.png 400w,
mozilla-dinosaur-head_120.png 120w"
sizes="(max-width: 480px) 120px,
400px"
src="mozilla-dinosaur-head_Original.png"
alt="Mozilla Logo"
>
</a>
<a href="https://addons.mozilla.org/">
<img
srcset="firefox-addons_120.png 120w,
firefox-addons_400.png 400w"
sizes="(max-width: 480px) 120px,
400px"
src="firefox-addons_400.png"
alt="Mozilla Add-Ons"
>
</a>
<a href="https://developer.mozilla.org/en-US/">
<img src="developer_mozilla_dinosar_head.svg" alt="Mozilla Developer Network Logo" >
</a>
<div class="clearfix"></div>
</div>
<div class="red-panda">
<!-- insert picture element -->
<picture>
<source media="(max-width: 600px)" srcset="red-panda-closeup.png">
<source media="(min-width: 601px)" srcset="red-panda-1200.jpeg">
<img src="red-panda-Original.jpg" alt="The beautiful red panda">
</picture>
</div>
</main>
Hello. Just finished “Mozilla splash page” assessment. Here is the link: https://cipdanila.github.io/splash-page/. Any suggestion, especially regarding the mobile version of my site? Thank you!