我正在使用 Foundation 5 的顶部栏,我希望栏是全宽的,但实际的导航链接要包含在网格中。我希望导航项与文本正文对齐。
我试过在导航中添加行和/或列。我试过在导航中使用 .contain-to-grid
但似乎没有任何效果。
这是我的codepen看到的:http://codepen.io/eladrin201/pen/BNGroR
最佳答案
你应该用 .contain-to-grid
将 nav 包裹在外面而不是里面。
<div class="contain-to-grid"> <!-- Wrap -->
<nav class="top-bar" data-topbar role="navigation">
<ul class="title-area">
<li class="name"></li>
<!-- Rest of code -->
</ul>
</nav>
</div>
默认 CSS
.contain-to-grid .top-bar { /* Targets the descendant/child element */
margin: 0 auto;
max-width: 62.5rem;
}
关于html - Foundation 5 Top Bar 全宽,但内部元素包含在网格中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31703637/