Home > Enterprise >  Center The Main Navigation Bar
Center The Main Navigation Bar

Time:03-13

Trying to center the main navigation bar in the the HitMag wordpress theme.

Here is an example of the site, https://www.goldenira.net

The main nav bar at the top is aligned to the left. I want it to align to the center.

Any help would be greatly appreciated. :)

CodePudding user response:

Use this code:

.navigation{
display: flex;
justify-content: center;
}
<div >
  <h1>Hello!<h1>
<div>

display: flex;

This applies flex to the container

justify-content: center;

This is going to center the div in it.

Great tutorial and cheatsheet about flex is here

CodePudding user response:

In .main-navigation css class use display: flex;

  • Related