div grow full width/height of remaining view port
A Pen by Gabriel Linassi on CodePen.
div grow full width/height of remaining view port
A Pen by Gabriel Linassi on CodePen.
<body class="container"> | |
<nav class="nav"> | |
<ul class="nav__list"> | |
<li class="nav__item"> | |
<a class="nav__link" href="#">Home</a></li> | |
<li class="nav__item"> | |
<a class="nav__link" href="#">About</a></li> | |
<li class="nav__item"> | |
<a class="nav__link" href="#">Contact</a></li> | |
</ul> | |
</nav> | |
<div class="grow-full-width"></div> | |
</body> |
@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@400&display=swap"); | |
body { | |
height: 100vh; | |
font-family: "Poppins", sans-serif; | |
background: #2d3142; | |
color: #ffffff; | |
margin: 0; | |
padding: 0; | |
} | |
.container { | |
padding: 0 40px; | |
display: flex; | |
flex-direction: column; | |
} | |
.nav { | |
display: flex; | |
align-items: center; | |
justify-content: center; | |
margin: 40px; | |
} | |
.nav__list { | |
display: flex; | |
list-style: none; | |
margin: 0; | |
padding: 0; | |
} | |
.nav__link { | |
color: inherit; | |
text-decoration: none; | |
padding: 1rem; | |
} | |
.grow-full-width { | |
background: #4b4b4d; | |
flex-grow: 1; | |
} | |