-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathfooter.html
57 lines (51 loc) · 1.1 KB
/
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<style>
body {
margin: 0px;
}
html, body {
height: 100%;
width: 100%;
}
#container {
width: 100%;
min-height: 100%;
position: absolute;
}
#content {
height: 300px;
width: 100%;
background-color: coral;
}
#content.overflowing {
height: 2000px;
}
#footer {
width: 100%;
height: 50px;
background-color: teal;
text-align: center;
position: absolute;
bottom: 0;
}
</style>
</head>
<body>
<div id="container">
<div id="content">Tap to make content taller/shorter than viewport.</div>
<div id="footer">FOOTER</div>
</div>
</body>
<script>
var content = document.getElementById("content");
content.addEventListener('click', function() {
if (content.className === 'overflowing')
content.className = '';
else
content.className = 'overflowing';
});
</script>
</html>