Gavin W Gavin W - 6 months ago 19
HTML Question

Center NavBar content/links

I need to center the content-links in my navbar. This:
enter image description here

I want the Home, About and Contact to be centered on the navbar.

Answer

Instead of using float, you can set the li element to display: inline-block and add text-align: center on the ul element.

ul {
    text-align: center;
}
li {
    display: inline-block
}

Example: https://jsfiddle.net/bjwskbcu/