Skip to content

Instantly share code, notes, and snippets.

@enggsuraj
Created December 30, 2021 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save enggsuraj/b1ddff1bee21a0fd333cd59014cfe9be to your computer and use it in GitHub Desktop.
Save enggsuraj/b1ddff1bee21a0fd333cd59014cfe9be to your computer and use it in GitHub Desktop.
Stickty Footer at bottom without overlapping content
<!DOCTYPE html>
<html>
<head>
<style>
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
.container {
display: flex;
flex-direction: column;
min-height: 100vh;
}
.content {
padding-bottom: 10px;
min-height: 100%;
}
footer {
flex: 0 0 50px; /*or just height:50px;*/
margin-top: auto;
}
</style>
</head>
<body>
<div class="container">
<div class="content">
<!-- DYNAMIC CONTENT -->
</div>
<footer>
Copyright@demo 2022
</footer>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment