Skip to content

Commit 25bada7

Browse files
authored
fix(css): footer positioning on large screens #418
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 25bada7

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

static/css/main.css

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

0 commit comments

Comments
 (0)