You could use the calc
function to make the .rightpage
the correct width.
html, body {
width: 100%;
height: 100%;
}
.leftnav {
width: 160px;
height: 100%;
position: fixed;
left: 0;
top: 0;
background: blue;
}
.rightpage {
width: calc(100% - 160px);
height: 100%;
margin-left: 160px;
background: red;
}
.topnav {
width: 100%;
height: 40px;
left: 160px;
top: 0;
background: green;
}
Check out this codepen demo