-
Notifications
You must be signed in to change notification settings - Fork 843
/
Copy pathsticky-footer-flexbox--download.html
67 lines (48 loc) · 1.26 KB
/
sticky-footer-flexbox--download.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<!-- this is an example from the MDN Layout Cookbook -->
<title>CSS Cookbook: sticky footer with flexbox</title>
<style>
body {
background-color: #fff;
color: #333;
font: 1.2em / 1.5 Helvetica Neue, Helvetica, Arial, sans-serif;
padding: 0;
margin: 0;
}
* {
box-sizing: border-box;
}
.wrapper {
min-height: 100%;
display: flex;
flex-direction: column;
}
.page-header,
.page-footer {
background-color: rgb(75, 70, 74);
color: #fff;
padding: 20px;
flex-shrink: 0;
}
.page-body {
padding: 20px;
flex-grow: 1;
}
.preview {
height: 400px;
overflow: auto;
}
</style>
</head>
<body>
<div class="wrapper">
<header class="page-header">This is the header</header>
<main class="page-body">
<p>Main page content here, add more if you want to see the footer push down.</p>
</main>
<footer class="page-footer">Sticky footer</footer>
</div>
</html>