Skip to content

Commit 475c1cb

Browse files
committed
fix: make footer stick to bottom on pages with minimal content
Adds flexbox layout to ensure footer stays at bottom of viewport regardless of content height. Fixes footer floating mid-page on pages like 404.
1 parent ddf7813 commit 475c1cb

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

static/css/main.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,3 +606,27 @@ iframe.poll {
606606
border: 1px solid var(--docsearch-primary-color)
607607
}
608608
}
609+
/*sticky footer fix*/
610+
html {
611+
height: 100%;
612+
}
613+
614+
body {
615+
min-height: 100vh;
616+
display: flex;
617+
flex-direction: column;
618+
margin: 0;
619+
}
620+
621+
body > nav {
622+
flex-shrink: 0;
623+
}
624+
625+
body > main {
626+
flex: 1 0 auto;
627+
}
628+
629+
body > footer {
630+
flex-shrink: 0;
631+
margin-top: auto;
632+
}

0 commit comments

Comments
 (0)