Tribute Page img responsive not working

This is the assignment but i am not able to get it responsive:

  • The element should responsively resize, relative to the width of its parent element, without exceeding its original size.

This is my code if anyone can look at it, my guess is that i have problems because i used more than one image but i cant seem to find a fix to this problem:

Welcome to the forums @laurentlugtenburg. When a test fails click the red button to see which test(s) are failing and text to help you correct the issue.

  • Be sure and read more than just the first line of the failing message. The ability to read and comprehend error messages is a skill you’ll need to acquire as a developer. Ask questions on what you don’t understand.

The full failing message says

The <img> element should responsively resize, relative to the width of its parent element, without exceeding its original size.
Try using the "max-width" style property : expected 'none' to not equal 'none'
AssertionError: Try using the "max-width" style property : expected 'none' to not equal 'none'
1 Like

Thanks for welcoming me

I read the failing message completly but still could’nt make the code work.
Can you maybe look at the code and give me a feedback of what the problem is here?

Hi, you should put the all those images on a parent element it can be a div id=“parent-img” and then in the CSS

  1. #parent-img {width:100%}
  2. #parent-img<img {width: choose the size that you want}
    It should resolve the problem, I had the same problem today

Thank you for your response

I tried it in my code but it didn’t work i tried using it with height: auto; also after width alone didnt work.

Do you have another solution for this problem?

I don’t see where there is any change in your code. The img element (which is coded with id="image") still has width. The failing message tells you what it’s looking for. When I make that change all tests pass.

1 Like

Thank you for your help

I was looking at the wrong element that was the problem.
I changed it and all my tests passed.

Hi @laurentlugtenburg !

Welcome to the forum!

I moved your post over to the html and css section since you weren’t asking for feedback but rather asking for help on passing one of the tests.

If you are finished with the tribute page and would like feedback, then you can create a new post in the #project-feedback section.

Understand. That’s why it’s important to read all the failing message and read it thoroughly.
Good job getting it fixed.

There are issues with your page that you need to address still but you probably know that. If you’d like feedback be sure to ask in the #project-feedback subforum.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.