Why is my code not working?

Tell us what’s happening:
First, I tried it on my own, but failed. Then I saw the video, which said the exact same thing. I even copied the code from the “Get a Hint” section but still I get nothing. Says I have to make height and width 100, which I did! Please help me out: https://www.freecodecamp.org/learn/responsive-web-design/responsive-web-design-principles/use-a-retina-image-for-higher-resolution-displays

Update: I tried the Edge browser, worked in one go, seems to me that the browsers that I tried on, stored some sort of cookies or history which allowed me not to do it… Anyway, where can I report it?

Your code so far


<style>
img {
   height: 100px; width: 100px;
}
</style>

<img src="https://s3.amazonaws.com/freecodecamp/FCCStickers-CamperBot200x200.jpg" alt="freeCodeCamp sticker that says 'Because CamperBot Cares'">

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.130 Safari/537.36.

Challenge: Use a Retina Image for Higher Resolution Displays

Link to the challenge:
https://www.freecodecamp.org/learn/responsive-web-design/responsive-web-design-principles/use-a-retina-image-for-higher-resolution-displays

Welcome!

What browser are you using?

Your code is 100% correct for me in Chrome browser.

1 Like

I have tried chrome browser, Mozilla, Brave Browser too. Then? I have disabled all extensions, other codes seems to work just fine!

Update: I tried the Edge browser, worked in one go, seems to me that the browsers that I tried on, stored some sort of cookies or history which allowed me not to do it… Anyway, where can I report it?

I don’t see any issues.

You can continue on in the challenges. And skip this one.

Free Code Camp is all open source :slight_smile: We all help make it better! But the true wizards behind the scenes are here:

https://github.com/freeCodeCamp/freeCodeCamp/blob/master/curriculum/challenges/english/01-responsive-web-design/responsive-web-design-principles/use-a-retina-image-for-higher-resolution-displays.english.md

Your code should look like this:
Note: I removed the semi-colon after the width value (no “;”)


<style>

img { height: 100px; width: 100px }

</style>

<img src="https://s3.amazonaws.com/freecodecamp/FCCStickers-CamperBot200x200.jpg" alt="freeCodeCamp sticker that says 'Because CamperBot Cares'">

There is no such rule, in fact many would consider leaving out the last semicolon a bad practice.

1 Like

Oh, thanks a lot. I learn something new today.