Can't Center Nav Div

北城余情 提交于 2019-12-13 06:25:12

问题


Okay, so I've looked at various posts on StackOverflow addressing the problem of centering a nav div. The solution seems to be:

.menu {
  text-align: center;
}

But no matter what div wrapping around the nav I use this on it does nothing. You can see the problem at http://www.dustinlee.co

I'm using this framework: https://github.com/jbckmn/naked-wordpress

Notice the navigation is on the left hand side. Even more strange, when you resize the window it begins to almost to the center.

Adding even more to my confusion is the fact that it's wrapped in this:

<nav class="site-navigation main-navigation">

Which seems to be associated with nothing in the styles.


回答1:


add this to your css

header nav ul{display:inline-block;}


来源:https://stackoverflow.com/questions/16820728/cant-center-nav-div

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!