From 9ffa13539fe72495cf54501edd55d4e1143b3f86 Mon Sep 17 00:00:00 2001 From: Michael Romero Date: Tue, 6 Jun 2017 23:32:03 -0700 Subject: [PATCH] Sticky footer with dynmaic height using flexbox --- static/css/main.css | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/static/css/main.css b/static/css/main.css index 2a5f529..3131f96 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -1,4 +1,7 @@ /* --- General --- */ +html, body { + height: 100%; +} body { font-family: 'Lora', 'Times New Roman', serif; @@ -6,6 +9,11 @@ body { color: #404040; position: relative; background: #FFF; + display: flex; + flex-flow: column; +} +.container[role=main] { + margin-bottom:50px; } p { line-height: 1.5; @@ -259,7 +267,7 @@ footer { padding: 30px 0; background: #F5F5F5; border-top: 1px #EAEAEA solid; - margin-top: 50px; + margin-top: auto; font-size: 14px; }