Layout with sticky footer
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
68
69
70
71
72
73
74
75
76
77
78
79
| <html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Layout with sticky footer</title>
<style type="text/css">
/** Layout with sticky fixed footer **/
* {
margin:0;
padding:0;
}
body,html {
margin: 0px;
padding: 0px;
height: 100%;
text-align: center;
}
.fixedwidth {
width: 800px; /* content width */
margin: 0 auto;
text-align: left;
}
#wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -7em; /* -(#footer/#push height) */
}
#header {
background-color: #000;
color: #fff;
height: 40px; /* header height */
}
#main {
}
#menu {
}
#content {
}
#footer {
clear:both;
background-color: #444;
}
#push, #footer {
height: 7em; /* footer height */
}
/** Layout with sticky fixed footer END **/
</style>
</head>
<body id="body">
<div id="wrapper">
<div id="header">
<div class="fixedwidth">
HEADER
</div>
</div>
<div id="main">
<div id="menu">
<div class="fixedwidth">
MENU
</div>
</div>
<div id="content">
<div class="fixedwidth">
CONTENT
</div>
</div>
</div>
<div id="push"></div>
</div>
<div id="footer">
<div class="fixedwidth">
FOOTER
</div>
</div>
</body>
</html> |
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>Layout with sticky footer</title>
<style type="text/css">
/** Layout with sticky fixed footer **/
* {
margin:0;
padding:0;
}
body,html {
margin: 0px;
padding: 0px;
height: 100%;
text-align: center;
}
.fixedwidth {
width: 800px; /* content width */
margin: 0 auto;
text-align: left;
}
#wrapper {
min-height: 100%;
height: auto !important;
height: 100%;
margin: 0 auto -7em; /* -(#footer/#push height) */
}
#header {
background-color: #000;
color: #fff;
height: 40px; /* header height */
}
#main {
}
#menu {
}
#content {
}
#footer {
clear:both;
background-color: #444;
}
#push, #footer {
height: 7em; /* footer height */
}
/** Layout with sticky fixed footer END **/
</style>
</head>
<body id="body">
<div id="wrapper">
<div id="header">
<div class="fixedwidth">
HEADER
</div>
</div>
<div id="main">
<div id="menu">
<div class="fixedwidth">
MENU
</div>
</div>
<div id="content">
<div class="fixedwidth">
CONTENT
</div>
</div>
</div>
<div id="push"></div>
</div>
<div id="footer">
<div class="fixedwidth">
FOOTER
</div>
</div>
</body>
</html>