Skip to content

Instantly share code, notes, and snippets.

@matt-bertoncello
Created May 18, 2020 08:05
Show Gist options
  • Save matt-bertoncello/c1e276a8e45c1e620fe1557b6e6ee68d to your computer and use it in GitHub Desktop.
Save matt-bertoncello/c1e276a8e45c1e620fe1557b6e6ee68d to your computer and use it in GitHub Desktop.
CSS and HTML implementation of a div that is the size of the user's window. If the content in div is bigger, the container will expand.
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="/stylesheets/windowsized_container.css" />
</head>
<nav></nav>
<body>
<div class='full-page'>
Test.
</div>
</body>
</html>
:root {
--header-height: 50px;
}
.full-page {
min-height: calc(100vh - var(--header-height));
height: 100%;
display: flex;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment