Skip to content

Commit 5b08fd5

Browse files
committed
feat: placing and spanning grid items.
1 parent 110dbdb commit 5b08fd5

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

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

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,12 +63,37 @@
6363
2) first row will the leftover height "1fr",
6464
which will filled the entire container.
6565
*/
66-
grid-template-rows: 1fr auto;
66+
/* grid-template-rows: 1fr auto; */
6767

68-
gap: 20px;
68+
/* gap: 20px; */
6969
column-gap: 30px;
70-
row-gap: 60px;
71-
height: 500px;
70+
row-gap: 40px;
71+
/* Set the proper container height */
72+
/* height: 500px; */
73+
}
74+
75+
.el--8 {
76+
grid-column: 2/3;
77+
/* Span to other rows */
78+
grid-row: 1 / span 2;
79+
grid-row: 1/3;
80+
}
81+
82+
.el--2 {
83+
/* Same as 1 / span 3 */
84+
/* grid-column: 1/4; */
85+
/* grid-column: 1 / span 3; */
86+
87+
/* Span 4 columns */
88+
/* grid-column: 1 / span 4; */
89+
90+
/* Span until the end of the grid */
91+
grid-column: 1 / -1;
92+
grid-row: 2;
93+
}
94+
95+
.el--6 {
96+
/* grid-row: 3 / 6; */
7297
}
7398

7499
.container--2 {
@@ -94,7 +119,7 @@
94119
<div class="el el--4">(4) are</div>
95120
<div class="el el--5">(5) amazing</div>
96121
<div class="el el--6">(6) languages</div>
97-
<div class="el el--7">(7) to</div>
122+
<!-- <div class="el el--7">(7) to</div> -->
98123
<div class="el el--8">(8) learn</div>
99124
</div>
100125

0 commit comments

Comments
 (0)