Cannot pas test > The <img> element should be centered within its parent element

I tried everything from justify-items ,text-align, align-items but can’t pass the test.
How solution for my code ?

This is my code:
Tribute Page

Hi @ryant_mp !

The problem is here


This test wants the img element with the id of image to be centered in the middle of the page.
Not on the left.

I would suggest deleting that float and the test will pass.

If you want to add other images that don’t have that id name, then you can position them wherever you want to.
But for this particular test, you need to have one image centered in the middle not the left.

Hope that helps!

I had removed float:left; but the text next image I had used float:right; become broken but the test passed. How solution for this ? I don’t have any idea

Remove the float left on the image and add some css styling to img-div. For example you could set img-div display to flex, give some margin to the image to center it, and change the text color of some elements to white instead of black.

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