-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcss-grid-positioning.html
78 lines (64 loc) · 1.31 KB
/
css-grid-positioning.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
67
68
69
70
71
72
73
74
75
76
77
78
<!DOCTYPE html>
<html>
<head>
<title>Css grid</title>
<style type="text/css">
.container{
background-color: lightgreen;
text-align: center;
font-size: larger;
color: white;
font-weight: bolder;
width: 700px;
margin: 70px 0 0 50px;
display: grid;
grid-template-columns: repeat(3,1fr);
grid-template-rows: repeat(2,100px) ;
grid-gap:25px 50px;
/*positioning*/
}
#item1{
background-color: orange;
grid-row-start: 2;
grid-row-end: 3;
grid-column-start: 3;
grid-column-end: 4;
}
#item2{
background-color: red;
}
#item3{
background-color: green;
/* grid-column-start: 2;
grid-column-end: 3;
grid-row-start:2;
grid-row-end: 3;*/
/*shorthands /// strta/end*/
/*grid-row: 2/3;
grid-column:2/3; */
/*grid-area: row start/col-start/row-end/col-end*/
grid-area: 2/2/3/3;
}
#item4{
background-color: blue;
/*height: 200px;*/
}
#item5{
background-color: gray;
}
#item6{
background-color: purple;
}
</style>
</head>
<body>
<div class="container">
<div id="item1">1</div>
<div id="item2">2</div>
<div id="item3">3</div>
<div id="item4">4</div>
<div id="item5">5</div>
<div id="item6">6</div>
</div>
</body>
</html>