Tell us why this code not work and getting error
Please find the below link to check
https://codepen.io/ajeetg/pen/mdrYZBa
Hey @ajeet-dev
Youāre very close to get it right
Here youāre targeting image
which doesnāt exist in your code, you probably mean #image
:
image{
max-width: 100%;
height: auto;
}
I made the change as you suggested but still showing error but responsive behavior is shown . Can you help me out why this error come.
Not sure if I spotted this correctly ā¦ born 1837?
Itās passed the test, so should be ok?
@ajeet-dev take a look at the error message:
Use the ādisplayā style property with a value of āblockā for responsive images.: expected āinlineā to equal āblockā
The requirement of the test suite for the image to be responsive is that it has a display property set to block
.
When I use display: block; my image not get centered
But in the tutorial it suggest that if the elements are there is no need to use display: block;
You can use margin
to center block element like so:
margin: 0 auto;
Iām not sure exactly what you mean. Iām just saying why you canāt pass this last test
Thank you @sitek94, now test passed. Thank you for help.
Test passed when code is:
#image{
display: block;
max-width: 100%;
height: auto;
margin: 0 auto;
}
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.