html - 如何居中对齐 float : left ul/li navigation menu with css?

标签 html css css-float

所以我使用以下 CSS 来显示水平导航栏:

.navigation ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.navigation li {
  float: left;
  margin: 0 1.15em;
  /*    margin: 0 auto;*/
}

.navigation {
  /*    width: auto;*/
  /*    margin: 0 auto;*/
  text-align: center;
}

我的问题是:如何将导航栏居中对齐到标题上方?

最佳答案

关于html - 如何居中对齐 float : left ul/li navigation menu with css?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1055134/

相关文章:

javascript - 在权重上添加/删除 css 类

html - 如何修复 Safari 和 FireFox 中的阿拉伯字体?

php - 从 while 循环打印的结果中的随机间隙?

html - 如何垂直堆叠居中的div

html - 将 HTML 内容添加到 Flash 网站

css - 容器内 float 元素(导航控件)的垂直居中

css - 透明 iFrame : shows text/content on the underlying page's background

javascript - 向 WP 主题添加新的导航菜单

javascript - 单击具有相同父 div 的按钮时显示 div

html - html 中的行更改 css