Can't Center Nav Div

2019-09-03 15:37发布

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条回答
干净又极端
2楼-- · 2019-09-03 16:33

add this to your css

header nav ul{display:inline-block;}
查看更多
登录 后发表回答