Simple Way
You can achieve this with setting both the top
and bottom
attributes of the nav to 0
and the position: absolute
. Set the container to position: relative
.
See how this is done
Modern Way (Flexbox)
IE11+ and all modern browsers support flexbox.
.container {
display: flex;
flex-direction: column;
}
.child {
flex-grow: 1;
}
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…