-
-
Save julianxhokaxhiu/04e7c61c404b36d28961 to your computer and use it in GitHub Desktop.
`display: table` sticky footer trick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<header class="page-row"> | |
<h1>Site Title</h1> | |
</header> | |
<main class="page-row page-row-expanded"> | |
<p>Page content goes here.</p> | |
</main> | |
<footer class="page-row"> | |
<p>Copyright, blah blah blah.</p> | |
</footer> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
html, | |
body { height: 100%; } | |
body { | |
display: table; | |
width: 100%; | |
} | |
.page-row { | |
display: table-row; | |
height: 1px; | |
} | |
.page-row-expanded { height: 100%; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment