I am trying to center my ul list with my div and for some reason it wont center. I also used my div to make the area around the img white with the text near it

Tell us what’s happening:
Describe your issue in detail here.
I am trying to center my ul list with my div and for some reason it wont center. I also used my div to make the area around the img white with the text near it. At first the ul centered normally but after removing the div and making the img background white which i used the div for it wouldnt center again and it would make the text background white which i wanted to avoid. if i could get some help that’d be great. thank you.

Your project link(s)

solution: https://codepen.io/khalidg88/pen/wvPjzzd

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.102 Safari/537.36

Challenge: Build a Tribute Page

Link to the challenge:

In order to center something it must take up less than the width of its parent container. Right now both the <div> and <ul> take up the full width of the page so there is nothing to center.

I would recommend you use a max-width on either the <div> or <ul> and then you can center with auto side margins.

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