Edit:
A solution that somehow feels less hacky could be to make the container (.wrapper
) as tall as the screen, and only add scrolling to the main <section>
element:
.wrapper {
display: flex;
height: 100vh;
}
section {
flex: 1 1 auto;
overflow: auto;
}
http://codepen.io/Sphinxxxx/pen/WjwbEO
Original answer:
You could simply put everything inside <nav>
in a wrapper (here: nav-wrapper
), and then fix that wrapper:
...
.nav-wrapper {
position: fixed;
top: 0; left: 0;
}
<nav role="navigation">
<div class="nav-wrapper">
...
</div>
</nav>
http://codepen.io/anon/pen/PqXYGM
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…