"Mozilla splash page" assessment

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:

>     <a href="https://www.mozilla.org/en-US/firefox/new/">  
>           <img srcset="images/dino120.png 120w,
>                        images/dino400.png 400w"
>                sizes="(max-width: 480px) 120px,
>                       (min-width: 481px) 400px"
>                src="images/dino400.png" alt="a red dinosaur head">
>         </a>

Is there anything wrong with my code? I can’t see any differences whenever I resize my browser.

2 Likes

I’ve not looked at this stuff for a while, but your code looks pretty reasonable.

Try comparing your code to the finished version here:

https://mdn.github.io/learning-area/html/multimedia-and-embedding/mdn-splash-page-finished/

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.

1 Like

Thank you!
In my laptop, everytime I get the 400px picture.

Hi,

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

1 Like

Cool, you found the answer I was going to give you :wink:

Apologies got not being faster to respond, but I was on vacation for 2 weeks. Back now!

Hi @chrismills ,

Below is the body of the html page for the assessment: https://developer.mozilla.org/en-US/docs/Learn/HTML/Multimedia_and_embedding/Mozilla_splash_page
I would appreciate if you can go through the file and let me know if it is correct.

<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>

HI, I’ve just finished the assement “Mozilla Spash Page” so I would like to somwone nice can give me the marking guide :smiley:
PS: Sorry for my bad english

Hello!

No problem at all. The marking guide is here:

And the finished example code can be found here:

Let me know if you need any more help.

Thanks!

2 posts were merged into an existing topic: “Adding features to our bouncing balls demo” assessment

4 posts were split to a new topic: HTML validator error message

4 posts were merged into an existing topic: “Adding features to our bouncing balls demo” assessment

4 posts were merged into an existing topic: “Adding features to our bouncing balls demo” assessment

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!

This looks pretty good to me, having compared it to our finished version: https://mdn.github.io/learning-area/html/multimedia-and-embedding/mdn-splash-page-finished/

If you want to check it out further, I’d recommend comparing your source code to our source code: https://github.com/mdn/learning-area/blob/master/html/multimedia-and-embedding/mdn-splash-page-finished/index.html

You can also find the marking guide here: https://github.com/mdn/learning-area/blob/master/html/multimedia-and-embedding/mdn-splash-page-finished/marking-guide.md

Let me know if you have any specific questions about it.

Best regards.

2 posts were merged into an existing topic: “Typesetting a community school home page” assessment

4 posts were merged into an existing topic: “Silly story generator” assessment

A post was merged into an existing topic: “Adding features to our bouncing balls demo” assessment

A post was merged into an existing topic: “Image gallery” assessment

8 posts were split to a new topic: Array module active learning “Printing those products!”

2 posts were split to a new topic: Multiple HTML assessments