So, I’m trying to align this menu I’ve created but there’s more space on the left than there’s on the right side and I don’t understand why this is happening.
Hi @pitthan.np. Welcome to FCC. It would be more helpful if you also provided a link to your code so that one is able to experiment with it to trace the problem.
Your menu is not centered horizontally because the ul element has a default left padding of 40px
A topic in CSS flexbox might help if you study it.
Firstly, the menu1 id must have the following:
position: flex;
justify-content: space-around;
The position tag set to flex enable the elements to be flexible while the justify-content tag tells the browser how to arrange the elements. There are series of options for the justify-content tag, they include:
flex-start
flex-end
space-between
space-around
space-evenly
Then add appropriate margin for the menu1 id if necessary.
After trying the above codes, I’m optimistic you find the ones that match your need as well as answer your questions.
Please don’t be annoyed if it doesn’t turn out the way you expected, instead try something else because CODES DONT LIE.