Responsive Web Design: Image Response: Auto Display Probz

I have written word for word, space for space, the solution as shown in the video, and the code continues to tell me that the display is not set to “block.” I have logged out, logged back in, opened with different browsers, refreshed, moved the spaces around, deleted spaces, added spaces, moved the code around, etc. Nothing has worked. Code is below

curly bracket img max-width: 100%; display: block; height: auto; curly bracket

If you use the Ask for help button it is easier to see exactly what code you have. Or edit your post and use the code formatting, post all the code.

BTW, This is how I read your code (might just be a mistake):

curly bracket img max-width: 100%; display: block; height: auto; curly bracket

{ img
  max-width: 100%;
  display: block;
  height: auto;
}

It should be:

img {
..CSS
}

What I wrote was my attempt at code formatting, but adding “…CSS” did not change the result. Thank you for your feedback.

If you copy and paste the code from the challenge in the box under the “You can use:” does it fail the test?

Amharg, I don’t believe lasjorg meant to literally type “…CSS” within the curly brackets. This is just his placeholder text to show you where your CSS declarations go. The important fix is quoted below.

Lasjorg is pointing out that you should have the img tag outside of your curly brackets, not inside. The final, working code is written out below just as Lasjorg pointed out, just without the placeholder text. Let us know if this works for you.

img {
  max-width: 100%;
  display: block;
  height: auto;
}

1 Like

OH MY GATOS thank you. I’ve been stuck on this for months. And I needed to further explanation. It worked!