Please help how can i make my img element to be centered within its parent element

Tell us what’s happening:
Describe your issue in detail here.

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36 OPR/77.0.4054.277

Challenge: Build a Tribute Page

Link to the challenge:

Hi .
you can put <img> inside <div> and use text-align: center;.

Thanks a million. Its been solved.

@teegurl61.ti, while the solution provided does work the text-align property is best used for aligning text.

Rather than wrapping the img element in a div there is another way to center your image. Search for center an image css and the first hit will show you how to accomplish this using the margin property.
Try it when you have a free moment.

1 Like

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