How can I center my image element within the parent element?

How can I center my image element within the parent element?

Please put your question in the post; it is much easier to read that way. Thanks!

1 Like

done. would you help look into it now?

Your post still only had a link. I moved your question to the body of your post for you.

just put me through on how i can center my image element within the parent element. thanks!

Would you put me through, please?

Are you there to help me?

Hi, you can use flexbox to center it.

for example, in your div that spans the entire width of the page use

display:flex;
flex-direction:column;
align-items:center;

Give the image a width to size it according to your needs

Hi, thanks for the advice, figured it out already.
#image{
max-width: 100%;
height: auto;
display: block;
margin-left: auto;
margin-right: auto;
}

2 Likes

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