Kevin5
July 16, 2019, 2:59pm
1
How to reach the requirement?
The requirement is: The element should responsively resize, relative to the width of its parent element, without exceeding its original size.
I do this but it doesn’t work, what’s wrong?
img {
max-width: 100%;
}
Link to the challenge:
Learn to code. Build projects. Earn certifications.Since 2015, 40,000 graduates have gotten jobs at tech companies including Google, Apple, Amazon, and Microsoft.
Hi Kevin5,
Perhaps you can try to use what is explained in the lesson about responsive images at https://learn.freecodecamp.org/responsive-web-design/responsive-web-design-principles/make-an-image-responsive ?
Do let us know if it worked!
sandrab
Kevin5
July 17, 2019, 1:15am
3
It works! Thanks!
I forgot to add display: block; so it didn’t responsively resize relative to the width of its parent element.
I’m experiencing similar issues but I’ve added the display: block; to it and still getting a error code.
Hi. Is your image within a div?
I did it the way the video said to, and I’m still getting this error message:
// running tests Your responsive-img
class should have a max-width
set to 100%
. // tests completed
That should be working. I remember that some users (for another challenges) reported that they couldn’t pass a test, and when they tryied with a different browser it worked. You could try with another browser.
1 Like
Genius. Safari, Explorer and Firefox were having issues with this code. Chrome FTW. Thanks friend. Hope you’re safe during this pandemic.
1 Like
You’re welcome. Hope you too.
Thanks for answering @napolimatiase
I have tried it and it works
So the solution works only in Crome, it does not work in Edge nor in Firefox.
That is so at least in my case, it would be good to report this peculiarity in the solution.
Thanks, guys. Was stuck on this using Edge. Doing it with Chrome did let me to submit my results.
thanks, I had had same problem