我的网站上的顶部导航栏左对齐如下:
The top bar nav on my site is left aligned like this:
| Home | aveoTSD | Silent Nite |
我想像这样将顶部栏导航居中:
I would like to center the top bar nav like this:
| Home | aveoTSD | Silent Nite |
将它与带有示例"文本的红色条完全一样居中.
Center it exactly like the red bar with "Example" text.
这里是我的css.
您可以通过将其添加到您的 CSS 来实现(最好删除冲突的样式):
You can do it by adding this to your CSS (and preferably removing conflicting styles):
.top-bar-section ul {display: table; margin: 0 auto;}
.top-bar-section ul li {display: table-cell;}
这篇关于如何使 Zurb Foundation 顶部栏导航居中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何检查重复的 CSS 规则?How to check for duplicate CSS rules?(如何检查重复的 CSS 规则?)
删除多个文件中的重复 CSS 声明Remove duplicate CSS declarations across multiple files(删除多个文件中的重复 CSS 声明)
Google Drive CSS/JS 返回 404 错误Google Drive CSS/JS Returns 404 Error(Google Drive CSS/JS 返回 404 错误)
在按钮之间添加空间?Adding space between buttons?(在按钮之间添加空间?)
Sencha Touch Ext.navigation.View pop to rootSencha Touch Ext.navigation.View pop to root(Sencha Touch Ext.navigation.View pop to root)
使用 CSS 和单个列表的简单 2 列导航?Simple 2-column navigation with CSS and a single list?(使用 CSS 和单个列表的简单 2 列导航?)