I re-worked your entire solution, but it still gives the intended (I hope) output. See the jsfiddle.
The changes I made were (among others):
More semantic HTML5, like using section
, header
, and nav
elements for which they are intended (I recommend html5shiv if legacy browser support is an issue).
More concise CSS (no !important
declarations, more extensibility, etc.)
HTML:
<header id="banner">
Hello world
</header>
<nav>
<ul>
<li><a href="#">Placeholder</a></li>
<li><a href="#">Placeholder</a></li>
<li><a href="#">Placeholder</a></li>
</ul>
</nav>
<header id="banner2">
Hello again...
</header>
<section>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p>
</section>
CSS:
body,
html {
font-family: sans-serif;
height: 100vh;
margin: 0;
padding: 0;
overflow: none;
}
* {
box-sizing: border-box;
}
a {
color: gray;
}
#banner {
z-index: 999;
position: fixed;
left: 0;
top: 0;
width: 100%;
background: red;
padding: .5rem;
height: 2rem;
}
#banner2 {
background: orange;
position: fixed;
left: 20%;
top: 2rem;
width: 100%;
padding: .5rem;
height: 2rem;
z-index: 999;
}
nav {
position: fixed;
height: 100vh;
width: 20%;
background: blue;
margin-top: 2rem;
padding: .5rem;
}
nav ul {
list-style-type: none;
margin: 0;
padding: 0;
}
section {
float: right;
width: 80%;
padding: .5rem;
margin-top: 4rem;
background: green;
}
p {
margin: 0;
padding: 0;
}
Obviously you can make whatever style changes you want for your personal preferences and design requirements (like padding
, margin
, background-color
, etc.)
Your spec:

Before:

After:

The downside of this is that some of the elements use fixed heights. You'll have to adjust some stuff for different font sizes, and probably use media queries to make it all responsive.