Skip to content

Commit 31e6599

Browse files
author
Andy Chau
committed
App layout
1 parent 690a95e commit 31e6599

File tree

1 file changed

+127
-0
lines changed

1 file changed

+127
-0
lines changed
Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>App Layout</title>
8+
<style>
9+
* {
10+
margin: 0;
11+
padding: 0;
12+
box-sizing: border-box;
13+
}
14+
15+
body {
16+
font-family: sans-serif;
17+
color: #343a40;
18+
font-size: 24px;
19+
20+
height: 100vh;
21+
text-align: center;
22+
font-weight: bold;
23+
24+
display: grid;
25+
grid-template-columns: 80px 350px 1fr 200px;
26+
grid-template-rows: 80px 1fr;
27+
}
28+
29+
nav,
30+
section,
31+
main,
32+
aside {
33+
padding-top: 24px;
34+
}
35+
36+
nav {
37+
background-color: #343a40;
38+
color: #fff;
39+
grid-row: 1 / -1;
40+
}
41+
42+
menu {
43+
background-color: #7048e8;
44+
color: #fff;
45+
grid-column: 2 / -1;
46+
display: flex;
47+
align-items: center;
48+
gap: 12px;
49+
padding: 0 40px;
50+
}
51+
52+
section {
53+
background-color: #e9ecef;
54+
padding: 40px;
55+
56+
display: flex;
57+
flex-direction: column;
58+
gap: 40px;
59+
}
60+
61+
aside {
62+
background-color: #e9ecef;
63+
}
64+
65+
button {
66+
display: inline-block;
67+
font-size: 16px;
68+
font-weight: bold;
69+
background-color: #5f3dc4;
70+
color: #fff;
71+
border: none;
72+
cursor: pointer;
73+
padding: 8px 12px;
74+
}
75+
76+
button:last-child {
77+
background-color: #d6336c;
78+
margin-left: auto;
79+
}
80+
81+
.email {
82+
background-color: #adb5bd;
83+
height: 96px;
84+
85+
display: flex;
86+
align-items: center;
87+
justify-content: center;
88+
}
89+
90+
section {
91+
/* How elements that don't fit into container appear */
92+
overflow: scroll;
93+
}
94+
95+
.email {
96+
/*
97+
when section enabled overflow scroll,
98+
we don't it to shrink to fit to container size,
99+
therefore need provide flex shrink to zero
100+
*/
101+
flex-shrink: 0;
102+
}
103+
</style>
104+
</head>
105+
<body>
106+
<nav>Nav</nav>
107+
<menu>
108+
<button>New</button>
109+
<button>Reply</button>
110+
<button>Forward</button>
111+
<button>Mark unread</button>
112+
<button>Trash</button>
113+
</menu>
114+
<section>
115+
<div class="email">Email 1</div>
116+
<div class="email">Email 2</div>
117+
<div class="email">Email 3</div>
118+
<div class="email">Email 4</div>
119+
<div class="email">Email 5</div>
120+
<div class="email">Email 6</div>
121+
<div class="email">Email 7</div>
122+
<div class="email">Email 8</div>
123+
</section>
124+
<main>Email view</main>
125+
<aside>Additional info</aside>
126+
</body>
127+
</html>

0 commit comments

Comments
 (0)