Skip to content

Commit 96e373d

Browse files
committed
Make footer stick to bottom of page
1 parent 7e70dd6 commit 96e373d

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
lines changed

html/css/style.css

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,14 @@ html, body {
77
html {
88
padding: 0;
99
width: 100%;
10+
position: relative;
11+
min-height: 100%;
1012
}
1113

1214
body {
1315
padding: 0 2em;
1416
width: auto;
17+
margin-bottom: 5.5em; /* max footer height */
1518
}
1619

1720
.title {
@@ -207,6 +210,8 @@ td p {
207210

208211
#formalities { font-style: italic; }
209212

213+
#content-wrapper { padding-bottom: 2em; }
214+
210215
#content {
211216
margin: 2em auto;
212217
overflow: hidden;
@@ -243,9 +248,18 @@ td p {
243248
padding-top: 0;
244249
}
245250

251+
#footer-wrapper {
252+
position: absolute;
253+
bottom: 0;
254+
width: 100%;
255+
margin: 0 -2em;
256+
padding-bottom: 2em;
257+
overflow: hidden;
258+
max-height: 5.5em; /* max footer height */
259+
}
260+
246261
#footer {
247-
margin: 2em auto;
262+
margin: 0 2em;
248263
padding: 0 1em;
249-
overflow: hidden;
250264
}
251265

template/footer_template.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
</div>
2+
</div>
3+
<div id="footer-wrapper">
24
<div id="footer" class="pretty-box yellow">
35
CONTENT
46
</div>
7+
</div>

template/header.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@
88
</div>
99
MENU
1010
</div>
11+
<div id="content-wrapper">
1112
<div id="content" class="pretty-box yellow">

0 commit comments

Comments
 (0)