Hey, guys, I need help centering my img within its parent element

What do you think is wrong?

It’s a little hard to be sure without the codepen link, but here are two things that I see:

  1. position: absolute may mess with responsiveness due to how img is removed from normal flow and therefore has no basis to compare for resizing.
  2. you have an additional width and alt attribute in your img which is a little odd.

Hey, buddy
can you access it through this link?

yup, and it seems like the image does responsively resize, also passes the resizing test. Only test you are not passing is the center your image test. Good job

oooh yesss
That’s also been a problem actually haha
Would you mind helping with it as well?

elements with a display value of block can be centered with the margin property.
See relevant challenge here :slight_smile:

1 Like

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