Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DonHuskini/4aceb9f4e45b25585f16b7f1a9726778 to your computer and use it in GitHub Desktop.
Save DonHuskini/4aceb9f4e45b25585f16b7f1a9726778 to your computer and use it in GitHub Desktop.
div grow full width/height of remaining view port
<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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment