-
Notifications
You must be signed in to change notification settings - Fork 0
/
CSS Sticky Footer.html
executable file
·82 lines (78 loc) · 2.74 KB
/
CSS Sticky Footer.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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta
name="viewport"
content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"
/>
<title>CSS Sticky Footer</title>
<!--
问题:如果页面内容不够长的时候,页脚块粘贴在视窗底部;如果内容足够长时,页脚块会被内容向下推送
-->
<style type="text/css">
* {
margin: 0;
padding: 0;
}
html,
body {
height: 100%;
}
body > .wrapper {
min-height: 100%;
background-color: rgba(255, 0, 0, 0.5);
text-align: center;
}
.content {
padding: 3vw;
padding-bottom: calc(150px + 3vw);
text-align: left;
text-indent: 32px;
background-color: rgba(0, 0, 255, 0.5);
}
.footer {
margin-top: -150px;
height: 150px;
background-color: rgba(0, 0, 0, 0.5);
text-align: center;
}
</style>
</head>
<body>
<div class="wrapper">
<h1 style="background-color: rgba(0, 255, 0, 0.5)">Site Name</h1>
<p class="content">
Bacon ipsum dolor amet salami pig jowl filet mignon. Spare ribs t-bone
picanha strip steak shoulder sirloin pig. Beef beef ribs tail, chuck
andouille filet mignon t-bone. Turkey tri-tip beef ribs, ribeye
hamburger shank salami cow pastrami ham hock turducken tenderloin swine.
Cupim jowl capicola tenderloin meatloaf pork. Ground round prosciutto
strip steak bresaola t-bone swine sausage bacon brisket landjaeger.
Kielbasa chuck jowl filet mignon, bresaola corned beef picanha alcatra
pig tongue fatback. Bacon ipsum dolor amet salami pig jowl filet mignon.
Spare ribs t-bone picanha strip steak shoulder sirloin pig. Beef beef
ribs tail, chuck andouille filet mignon t-bone. Turkey tri-tip beef
ribs, ribeye hamburger shank salami cow pastrami ham hock turducken
tenderloin swine. Cupim jowl capicola tenderloin meatloaf pork. Ground
round prosciutto strip steak bresaola t-bone swine sausage bacon brisket
landjaeger. Kielbasa chuck jowl filet mignon, bresaola corned beef
picanha alcatra pig tongue fatback.
</p>
</div>
<div class="footer">
<p style="height: 75px; line-height: 75px">© 2015 No rights reserved.</p>
<p
style="
height: 75px;
line-height: 75px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
"
>
Made with ♥ by an anonymous pastafarian.
</p>
</div>
</body>
</html>