File tree 2 files changed +116
-0
lines changed
2 files changed +116
-0
lines changed Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+
4
+ < head >
5
+ < meta charset ="UTF-8 ">
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7
+ < title > CSS Grid</ title >
8
+ < style >
9
+ .container {
10
+ width : 80vw ;
11
+ height : 100vh ;
12
+ border : 2px solid black;
13
+ display : grid;
14
+ /* grid-template-columns: [pehla] 120px [doosra] 100px [t]; */
15
+ /* grid-template-rows: 100px 100px 100px; */
16
+ /* grid-template-columns: repeat(4, minmax(100px, 1fr)); */
17
+ grid-template-columns : repeat (4 , 80px );
18
+ grid-template-rows : repeat (2 , 80px );
19
+ /* gap: 34px; */
20
+ row-gap : 10px ;
21
+ column-gap : 44px ;
22
+ justify-items : center;
23
+ align-items : center;
24
+ }
25
+
26
+ .item {
27
+ border : 2px solid red;
28
+ height : 55px ;
29
+ width : 55px ;
30
+ }
31
+
32
+ .item-4 {
33
+ /* grid-row: 1/2;
34
+ grid-column: pehla/t; */
35
+ }
36
+
37
+ .item-1 {
38
+ /* grid-row: 1/2; */
39
+ /* or you can do */
40
+ /* grid-row-start: 1;
41
+ grid-row-end: 2; */
42
+
43
+ /* same thing */
44
+ /* grid-column: 1/2; */
45
+ }
46
+ </ style >
47
+ </ head >
48
+
49
+ < body >
50
+ < div class ="container ">
51
+ < div class ="item item-1 "> 1</ div >
52
+ < div class ="item "> 2</ div >
53
+ < div class ="item "> 3</ div >
54
+ < div class ="item item-4 "> 4</ div >
55
+ < div class ="item "> 5</ div >
56
+ </ div >
57
+ </ body >
58
+
59
+ </ html >
Original file line number Diff line number Diff line change
1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+
4
+ < head >
5
+ < meta charset ="UTF-8 ">
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 ">
7
+ < title > CSS Grid</ title >
8
+ < style >
9
+ .container {
10
+ border : 2px solid black;
11
+ display : grid;
12
+ grid-template-areas : "nav nav nav"
13
+ "side article article"
14
+ "footer footer footer" ;
15
+ }
16
+
17
+ .item {
18
+ border : 2px solid red;
19
+ height : 55px ;
20
+ }
21
+
22
+ .item-1 {
23
+ grid-area : nav;
24
+ background-color : aqua;
25
+ }
26
+
27
+ .item-2 {
28
+ grid-area : side;
29
+ background-color : beige;
30
+ }
31
+
32
+ .item-3 {
33
+ grid-area : article;
34
+ background-color : azure;
35
+ }
36
+
37
+ .item-4 {
38
+ grid-area : footer;
39
+ }
40
+
41
+ .item-5 {
42
+ grid-area : nav;
43
+ }
44
+ </ style >
45
+ </ head >
46
+
47
+ < body >
48
+ < div class ="container ">
49
+ < div class ="item item-1 "> 1</ div >
50
+ < div class ="item item-2 "> 2</ div >
51
+ < div class ="item item-3 "> 3</ div >
52
+ < div class ="item item-4 "> 4</ div >
53
+ < div class ="item item-5 "> 5</ div >
54
+ </ div >
55
+ </ body >
56
+
57
+ </ html >
You can’t perform that action at this time.
0 commit comments