I am having difficulty with centering the navigation bar on this page.
I tried nav { margin: 0 auto; }
and a bunch of other ways, but I still can't center it.
Make your div container the 100% width. and set the text-align: element to center in the div container. Then in your <ul> set that class to have 3 particular elements: text-align:center; position: relative; and display: inline-block; that should center it.
To just center the text inside an element, use text-align: center; This text is centered.
It is always better to separate the "code" (HTML) and the styles (CSS), so in any case, CSS is the way to go. Show activity on this post. To be short, just don't use center tag.
#nav ul {
display: inline-block;
list-style-type: none;
}
It should work, I tested it in your site.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With