-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcss-grid-experiment.html
67 lines (58 loc) · 1.19 KB
/
css-grid-experiment.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">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Sticky Header and Footer with Flex Grid</title>
<style>
body {
margin: 0;
font-family: Arial, sans-serif;
}
header {
position: sticky;
top: 0;
background-color: black;
color: white;
padding: 10px;
text-align: center;
}
main {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 20px;
}
.article {
flex: 0 0 calc(33.33% - 20px);
background-color: #F7CAC9;
margin-bottom: 20px;
padding: 15px;
text-align: center;
}
footer {
position: sticky;
bottom: 0;
background-color: black;
color: white;
padding: 10px;
text-align: center;
}
</style>
</head>
<body>
<header>Site Title</header>
<main>
<div class="article">1</div>
<div class="article">2</div>
<div class="article">3</div>
<div class="article">4</div>
<div class="article">5</div>
<div class="article">6</div>
<div class="article">7</div>
<div class="article">8</div>
<div class="article">9</div>
</main>
<footer>This is the end.</footer>
</body>
</html>