Divi theme primary header menu center aligned


Staff member
<a href=" " rel="nofollow noreferrer"><img src=" " alt="enter image description here"></a>I'm using divi theme for a wordpress site. The top primary menu is right aligned by default. How can I customize it to have it center aligned?

Code :

@Media only screen and ( min-width: 981px ) {

/* Vertically center the top navigation */
#et-top-navigation { vertical-align: middle; float:none !important;}
.container { display:table; }

/* Center align the contents of the top navigation area */
#et-top-navigation { text-align:center; }
#et-top-navigation &gt; * { text-align:left; }

#top-menu-nav, #et_top_search { float:none !important; display:inline-block !important}
#et_top_search { vertical-align: top !important; margin-top:3px }