-
Notifications
You must be signed in to change notification settings - Fork 0
/
grid-responsive.css
84 lines (74 loc) · 1.58 KB
/
grid-responsive.css
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
* {
margin: 0;
font-family: 'SuisseIntl', 'Helvetica', 'Arial', sans-serif;
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
font-weight: normal;
background-color: #011627;
color: white;
}
.container {
display: grid;
/* grid area layout */
/* note: grid area names are case sensitive */
/* use '.' to declare no content (add remove the corresponding element from html) */
grid-template-areas:
'a x b'
'c x d';
/* three columns: col1:200px col2: (portion of remaining space) col3: 200px */
grid-template-columns: 200px 1fr 200px;
/* apportioning equal width rows is implied */
/*grid-template-rows: 1fr 1fr;*/
/* grid takes up the entire visible screen height */
height: 100vh;
}
/* responsive design */
/* if [device width] is less than or equal to 800px */
@media screen and (max-width: 800px) {
.container {
grid-template-areas:
'a b'
'x x'
'c d';
grid-template-columns: auto;
}
}
@media screen and (max-width: 600px) {
.container {
grid-template-areas:
'x x'
'a b'
'c d';
grid-template-columns: auto;
}
}
/*
'if [device width] is greater than or equal to 600px'
@media only screen and (min-width: 600px) {...}
@media all and (min-width: 600px) {...}
*/
/* layout the grid areas */
.l1 {
grid-area: a;
}
.r1 {
grid-area: b;
}
.l2 {
grid-area: c;
}
.r2 {
grid-area: d;
}
.container div {
border: 2px solid white;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.main {
grid-area: x;
font-size: 3rem;
border-width: 4px;
}