-
Notifications
You must be signed in to change notification settings - Fork 9
/
grid-layout.css
65 lines (51 loc) · 1.11 KB
/
grid-layout.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
.container {
display: grid;
}
/* grid-template-columns & rows */
grid-template-columns: 40px 40px auto;
grid-template-rows: 50% 50%;
/* gap */
column-gap: 10px;
row-gap: 10px;
/* justify-items & align-items */
justify-items: [value];
align-items: [value];
/* justify-content & align-content */
justify-content: [value];
align-content: [value];
/* column start & column end*/
grid-column-start: 2;
grid-column-end: 4;
/* row start & row end*/
grid-row-start: 1;
grid-row-end: 3;
/* justify-self & align-self */
justify-self: [value];
align-self: [value];
/* areas */
grid-area: [name];
grid-template-areas: "areas";
/* areas (example) */
.container: {
display: grid;
grid-template-columns: 50px 50px 50px 50px 50px;
grid-template-rows: 50px 50px 50px;
grid-template-areas:
"header header header header header"
"main main main section section"
"footer footer footer footer footer";
}
.item-1 {
grid-area: header;
}
.item-2 {
grid-area: main;
}
.item-3 {
grid-area: section;
}
.item-4 {
grid-area: footer;
}
/* repeat() & fr */
grid-template-columns: repeat(3, 1fr);