/
grid-1.html
63 lines (55 loc) · 1.42 KB
/
grid-1.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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>2 columns, 3 rows</title>
<link rel="stylesheet" href="css/stylesheet.css" />
<style type="text/css">
body {
display: grid;
grid-template-columns: 1fr 2fr 3fr;
grid-template-rows: 50px 1fr 50px;
margin: var(--spacing-large);
color: var(--ucla-black-80);
}
body > * {
padding: 1em;
border-radius: 10px;
}
header {
grid-column: 2 / -1;
grid-row: 1;
background-color: var(--ucla-blue);
}
aside {
grid-colummn: 1 / 2;
grid-row: 1;
background-color: var(--ucla-gold);
}
article {
grid-row: 2;
grid-column: 2 / -1;
background-color: var(--ucla-black-10);
}
footer {
grid-row: 3;
grid-column: 1 / 5;
background-color: hotpink;
}
</style>
</head>
<body>
<header>Page Header</header>
<aside>Sidebar</aside>
<article>
<h1>2 columns, 3 rows</h1>
<p><strong>header, article, sidebar and footer</strong></p>
<p>
This example uses line-based positioning, to position the header and
footer, stretching them across the grid.
</p>
</article>
<footer>Page Footer</footer>
</body>
</html>