Image Not Centering on Tribute Page

I’m having trouble figuring out how to center the image on my tribute page. I first tried doing so by setting the image’s margin-left and margin-right to auto. That didn’t work, and I have since resorted to using the exact method they used in the example. That isn’t working either. What am I missing? Thank you very much in advance.

try typing into your CSS img:

justify-content: center

I don’t know if it will work but try:)

For future reference, it is much better if you give us a link to your project so we can look at the whole thing. Sometimes a screenshot of what you think the problem is might not actually be the problem but we can’t know that unless we can look at everything.

just set it to margin: auto;

Only because I know which project you’re doing can I answer this. bbsmooth is correct, if you want help a screenshot is usually worthless. It’s better to provide a link to your project if you want help.

@CarterMoonstone provide html and css

Thank you for your input.

I have tried setting the margin to auto, and it didn’t work.

I have edited my post to include the URL like you suggested.

Thank you. I have added the link to the pen to my post.

Okay, I added the link in my post.

This link is a life saver

Your image is in a figure tag, which is a block level element, but the image itself (img tag) is an inline element.

1 Like

@CarterMoonstone, close your h1 block declaration and see what happens.

1 Like

You have everything right, you just need to close the block of h1 “{}”
so that the rules are followed of “img”

1 Like