Skip to content

Commit 2d88195

Browse files
Merge pull request #38 from BassOfBass/master
Fix for sticky footer examples in article not actually being sticky
2 parents 821e9ed + 6218d71 commit 2d88195

4 files changed

+38
-8
lines changed

css-cookbook/sticky-footer--download.html

+9-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,14 @@
1010
<link rel="stylesheet" href="styles.css">
1111

1212
<style>
13+
14+
html {
15+
height:100%;
16+
box-sizing: border-box;
17+
}
18+
1319
body {
20+
height:100%;
1421
background-color: #fff;
1522
color: #333;
1623
font: 1.2em / 1.5 Helvetica Neue, Helvetica, Arial, sans-serif;
@@ -19,12 +26,11 @@
1926
}
2027

2128
* {
22-
box-sizing: border-box;
29+
box-sizing: inherit;
2330
}
2431

2532
section {
26-
height: 400px;
27-
width: 500px;
33+
height: 100%
2834
}
2935

3036
.wrapper {

css-cookbook/sticky-footer-flexbox--download.html

+7-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@
1010

1111

1212
<style>
13+
html {
14+
height:100%;
15+
box-sizing: border-box;
16+
}
17+
1318
body {
19+
height: 100%;
1420
background-color: #fff;
1521
color: #333;
1622
font: 1.2em / 1.5 Helvetica Neue, Helvetica, Arial, sans-serif;
@@ -19,7 +25,7 @@
1925
}
2026

2127
* {
22-
box-sizing: border-box;
28+
box-sizing: inherit;
2329
}
2430

2531
.wrapper {

css-cookbook/sticky-footer-flexbox.html

+11-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,19 @@
1010
<link rel="stylesheet" href="styles.css">
1111

1212
<style>
13-
* {
13+
html {
14+
height:100%;
1415
box-sizing: border-box;
1516
}
1617

18+
* {
19+
box-sizing: inherit;
20+
}
21+
22+
body {
23+
height: 100%;
24+
}
25+
1726
.page-header,
1827
.page-footer {
1928
background-color: rgb(75, 70, 74);
@@ -28,7 +37,7 @@
2837
}
2938

3039
.preview {
31-
height: 400px;
40+
height: 100%;
3241
overflow: auto;
3342
}
3443
</style>

css-cookbook/sticky-footer.html

+11-2
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,19 @@
1010
<link rel="stylesheet" href="styles.css">
1111

1212
<style>
13-
* {
13+
html {
14+
height:100%;
1415
box-sizing: border-box;
1516
}
1617

18+
* {
19+
box-sizing: inherit;
20+
}
21+
22+
body {
23+
height: 100%;
24+
}
25+
1726
.page-header,
1827
.page-footer {
1928
background-color: rgb(75, 70, 74);
@@ -26,7 +35,7 @@
2635
}
2736

2837
.preview {
29-
height: 400px;
38+
height: 100%;
3039
overflow: auto;
3140
}
3241
</style>

0 commit comments

Comments
 (0)