-
Notifications
You must be signed in to change notification settings - Fork 0
/
30_grid_span.html
59 lines (55 loc) · 1.74 KB
/
30_grid_span.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grid Span</title>
<style>
.grid {
display: grid;
grid-template-columns: repeat(4, 1fr);
}
.item {
background-color: rgb(228, 181, 95);
border: yellow 1px solid;
color: white;
padding: 3rem;
text-align: center;
}
.item:first-child {
/* grid-column-start: 1; */
/*grid-column-end: 4;*/ /* span colums lines */
/* grid-row-start: 1; */
/*grid-row-end: 3;*/ /* span row lines */
grid-column: 1 / span 3; /* span colums */
grid-row: 1 / span 2; /* span rows */
}
.item:nth-child(9) {
grid-row: 4 / span 2; /* you have to specify correct initial row position for fix position*/
grid-column: 2 / span 3; /* you have to specify correct initial column position for fix position */
/* you can move element throught the grid */
/* grid-row: 2 / span 2; */
/* grid-column: 1 / span 3; */
}
</style>
</head>
<body>
<div class="grid">
<div class="item">Item 1</div>
<div class="item">Item 2</div>
<div class="item">Item 3</div>
<div class="item">Item 4</div>
<div class="item">Item 5</div>
<div class="item">Item 6</div>
<div class="item">Item 7</div>
<div class="item">Item 8</div>
<div class="item">Item 9</div>
<div class="item">Item 10</div>
<div class="item">Item 11</div>
<div class="item">Item 12</div>
<div class="item">Item 13</div>
<div class="item">Item 14</div>
<div class="item">Item 15</div>
</div>
</body>
</html>