Not sure what the issue is but something is clearly missing here.
Please let me know your thoughts, my code seems to be missing something: https://codepen.io/m4v3r1ck/pen/poNazrK
Thanks
Not sure what the issue is but something is clearly missing here.
Please let me know your thoughts, my code seems to be missing something: https://codepen.io/m4v3r1ck/pen/poNazrK
Thanks
Hi @m4v3r1ck !
Full error message:
The element should responsively resize, relative to the width of its parent element, without exceeding its original size.
Try using the âmax-widthâ style property
Any questions about the error message?
Hi @m4v3r1ck ,
Just something to point out, no need to put a closing tag on your img tag.
Check your code
You define a img-div but itâs empty in your css
<div id="img-div">
It was there from the start:
.responsive-img {
max-width: 100%;
height: auto;
}
Error message: " The element should responsively resize, relative to the width of its parent element, without exceeding its original size", not sure what the system needs to proceed honestly.
.responsive-img
in your HTML, so that selector doesnât do anythingimg
element has wrong syntax which can cause tests to fail. Youâve written <img id="image"></img>
, but an image tag is self-closing like this: <img id="image" />
As mentioned earlier responsive-img doesnât exist.
So I would just dump those styles of max width and height into here
#image {
width: 700px;
}
In order to pass the last test of centering the image properly, you will need to google how to center an image css. The first few results will give the answer.
It will show you how to change the display property and use the margin property to center it.
Done. It was good for a minute, then I fixed the code to handle the âcenterâ requirement then it went back to asking for image responsiveness.
I know I am close and Iâm not giving up, I will get it right.
Worked on the code the responsive part seemed to be good, then it asked for the image to be centered, after which it went back to asking for responsiveness.
I know itâs a little error here and there but I will get it to work.
Okay cool, re-read every line of code and re-worked the #image portion in CSS, good to go.
Thanks everyone!
If you are still struggling, try changing display of the image (as by default image is an inline element) and centering your image using margin. Hope this helps
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.