Skip to content

Commit 2a41f02

Browse files
committed
section-4: CCS grid experimentations.
1 parent 2070921 commit 2a41f02

File tree

1 file changed

+37
-4
lines changed

1 file changed

+37
-4
lines changed

starter/04-CSS-Layouts/css-grid.html

Lines changed: 37 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,14 @@
1111
}
1212
.el--2 {
1313
background-color: orangered;
14+
/* grid-column: 1 / 2; */
15+
/* grid-column: 1 / -1; */
16+
grid-column: 1 / span 1;
17+
grid-row: 2 / 3;
1418
}
1519
.el--3 {
1620
background-color: green;
17-
height: 150px;
21+
/* height: 150px; */
1822
}
1923
.el--4 {
2024
background-color: goldenrod;
@@ -24,35 +28,64 @@
2428
}
2529
.el--6 {
2630
background-color: steelblue;
31+
grid-column: 4 / span 1;
32+
grid-row: 1 / span 2;
2733
}
2834
.el--7 {
2935
background-color: yellow;
3036
}
3137
.el--8 {
3238
background-color: crimson;
39+
grid-column: 2 / 3;
40+
grid-row: 1 / 2;
3341
}
3442

3543
.container--1 {
3644
/* STARTER */
3745
font-family: sans-serif;
3846
background-color: #ddd;
39-
font-size: 40px;
47+
font-size: 32px;
4048
margin: 40px;
49+
height: 500px;
4150

4251
/* CSS GRID */
52+
display: grid;
53+
/* gap: 30px; */
54+
column-gap: 10px;
55+
row-gap: 40px;
56+
/* grid-template-columns: 2fr 1fr 1fr auto; */
57+
grid-template-columns: repeat(4, 1fr);
58+
/* grid-template-rows: 300px 200px; */
59+
grid-template-rows: 1fr 1fr;
4360
}
4461

4562
.container--2 {
4663
/* STARTER */
4764
font-family: sans-serif;
4865
background-color: black;
4966
font-size: 40px;
50-
margin: 100px;
67+
margin: 40px;
5168

52-
width: 1000px;
69+
width: 700px;
5370
height: 600px;
5471

5572
/* CSS GRID */
73+
display: grid;
74+
grid-template-columns: 125px 200px 125px;
75+
grid-template-rows: 250px 100px;
76+
gap: 10px;
77+
78+
/* Align tracks in container. Distribute empty space. */
79+
justify-content: center;
80+
align-content: center;
81+
82+
/* Align items inside cells. */
83+
align-items: center;
84+
justify-items: center;
85+
}
86+
87+
.el--3 {
88+
align-self: end;
5689
}
5790
</style>
5891
</head>

0 commit comments

Comments
 (0)