如何使 Zurb Foundation 顶部栏导航居中?

2022-01-10 00:00:00 navigation css nav center zurb-foundation

我的网站上的顶部导航栏左对齐如下:

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;}

相关文章