-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgrid-lines.html
66 lines (66 loc) · 1.61 KB
/
grid-lines.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
60
61
62
63
64
65
66
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Grid Lines</title>
<style>
body {
text-align: center;
color: #fff;
}
#content {
display: grid;
grid-template-columns: repeat(6, 1fr);
grid-template-rows: repeat(4, minmax(150px, auto));
margin: 0 auto;
grid-gap: 10px;
max-width: 960px;
}
#content div {
background: green;
padding: 30px;
}
#content div:nth-child(even){
background: black;
}
.one {
/* Start Lin1 and End at line 3 grid */
/* grid-column-start: 1;
grid-column-end: 3; */
/* same as start and end line seperately */
grid-column: 1/3;
}
.two {
grid-column: 3/7;
}
.three {
/*start and end of a Column*/
grid-column: 1/4;
/*start and end of a row*/
grid-row: 2/4;
}
.four {
grid-column: 4/7;
grid-row: 2/4;
}
.five {
grid-column: 3/7;
}
.six {
grid-row: 4;
grid-column: 1/3;
}
</style>
</head>
<body>
<div id="content">
<div class="one">1</div>
<div class="two">2</div>
<div class="three">3</div>
<div class="four">4</div>
<div class="five">5</div>
<div class="six">6</div>
</div>
</body>
</html>