/
index-css-absolute.html
65 lines (62 loc) · 1.33 KB
/
index-css-absolute.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
<!DOCTYPE html>
<html lang="zh">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
<style>
* {
margin: 0
}
body {
position: relative;
min-height: 100vh;
}
.container {
padding-bottom: 50px;
}
footer {
position: absolute;
bottom: 0;
left: 0;
height: 50px;
width: 100%;
background: yellow;
}
</style>
</head>
<body>
<article id="app" class="container">
<header>
<h2>foot 始终在顶部测试</h2>
</header>
<section class="main">
占位数:<button v-for="item in list" :key="`btn-${item}`" @click="changeCount(item)">{{item}}</button>
<div v-for="item in count" :key="`gap-${item}`">
占位 {{item}}
</div>
</section>
<footer>
Copyright © 2016-2021 zuo11.com. 鄂ICP备16014741号-1
</footer>
</article>
<script>
let app = new Vue({
el: '#app',
data() {
return {
list: [5, 50, 100],
count: 5
}
},
methods: {
changeCount(value) {
this.count = value
}
}
})
</script>
</body>
</html>