如何将主菜单移动到joomla的中心

如何将主菜单移动到joomla的中心,joomla,joomla3.0,Joomla,Joomla3.0,我的主菜单是左对齐的。我想将我的主菜单项移动到页面中心。我使用的是protostar模板。如果您使用的是Joomla 3.5或更高版本,请在以下位置创建一个文件:templates/protostar/css/user.css,如果该文件尚不存在,请将以下内容添加到该文件中: .navigation{ 文本对齐:居中; } .导航{ 显示:内联块; }如果使用template protostar,则打开文件夹templates\protostar\css\template.css中的文件temp

我的主菜单是左对齐的。我想将我的主菜单项移动到页面中心。我使用的是protostar模板。

如果您使用的是Joomla 3.5或更高版本,请在以下位置创建一个文件:
templates/protostar/css/user.css
,如果该文件尚不存在,请将以下内容添加到该文件中:

.navigation{
文本对齐:居中;
}
.导航{
显示:内联块;

}

如果使用template protostar,则打开文件夹templates\protostar\css\template.css中的文件template.css。 并找到代码行:

.navigation .nav-pills {
    margin-bottom: 0;
}
添加代码:

.navigation .nav-pills {
   margin-bottom: 0;
   display: flex;
   justify-content: center;
}

我创建了user.css文件并添加了上面的代码,但没有效果。如果启用,请尝试清除Joomla缓存和任何服务器端缓存,例如SiteGround动态缓存。我意识到新的user.css文件没有保存在正确的目录中。我通过浏览器将其移动到CSS文件夹,并重新启动了服务。成功了。非常感谢。