-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcomplex-layout-challenge.html
63 lines (63 loc) · 1.55 KB
/
complex-layout-challenge.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
<html>
<head>
<title>Complex Layout Challenge</title>
<meta name="viewport" content="width=device-width,initial-scale=1" />
<style>
/*
Task 3: When the device width is 800px and lower, only show
"header menu", "main" and "footer".
*/
.container {
display: grid;
grid-template-columns: 10% 1fr auto;
grid-template-rows: auto 1fr auto;
grid-template-areas:
"header-logo header-menu header-menu"
"left-menu main main"
"left-menu footer footer";
height: 100vh;
}
@media (max-width: 800px) {
.container {
display: grid;
grid-template-areas:
"header-menu"
"main"
"footer";
grid-template-columns: 100%;
grid-template-rows: 1fr 1fr 1fr;
}
}
.header-logo {
grid-area: header-logo;
}
.header-menu {
grid-area: header-menu;
}
.left-menu {
grid-area: left-menu;
}
.main {
grid-area: main;
}
.footer {
grid-area: footer;
}
div {
border: 2px solid brown;
background-color: beige;
padding: 20px;
box-sizing: border-box;
}
</style>
</head>
<body>
<div class="container">
<div class="header-logo">logo</div>
<div class="header-menu">header menu</div>
<div class="left-menu">left menu</div>
<div class="main">main</div>
<div class="footer">footer</div>
</div>
</body>
</html>