|
1 | 1 | <!DOCTYPE html> |
2 | 2 | <html lang="en"> |
3 | | - <head> |
4 | | - <meta charset="UTF-8" /> |
5 | | - <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
6 | | - <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
7 | | - <title>CSS Grid</title> |
8 | | - <style> |
9 | | - .el--1 { |
10 | | - background-color: blueviolet; |
11 | | - } |
12 | | - .el--2 { |
13 | | - background-color: orangered; |
14 | | - } |
15 | | - .el--3 { |
16 | | - background-color: green; |
17 | | - height: 150px; |
18 | | - } |
19 | | - .el--4 { |
20 | | - background-color: goldenrod; |
21 | | - } |
22 | | - .el--5 { |
23 | | - background-color: palevioletred; |
24 | | - } |
25 | | - .el--6 { |
26 | | - background-color: steelblue; |
27 | | - } |
28 | | - .el--7 { |
29 | | - background-color: yellow; |
30 | | - } |
31 | | - .el--8 { |
32 | | - background-color: crimson; |
33 | | - } |
| 3 | + <head> |
| 4 | + <meta charset="UTF-8" /> |
| 5 | + <meta http-equiv="X-UA-Compatible" content="IE=edge" /> |
| 6 | + <meta name="viewport" content="width=device-width, initial-scale=1.0" /> |
| 7 | + <title>CSS Grid</title> |
| 8 | + <style> |
| 9 | + .el--1 { |
| 10 | + background-color: blueviolet; |
| 11 | + } |
| 12 | + .el--2 { |
| 13 | + background-color: orangered; |
| 14 | + } |
| 15 | + .el--3 { |
| 16 | + background-color: green; |
| 17 | + height: 150px; |
| 18 | + } |
| 19 | + .el--4 { |
| 20 | + background-color: goldenrod; |
| 21 | + } |
| 22 | + .el--5 { |
| 23 | + background-color: palevioletred; |
| 24 | + } |
| 25 | + .el--6 { |
| 26 | + background-color: steelblue; |
| 27 | + } |
| 28 | + .el--7 { |
| 29 | + background-color: yellow; |
| 30 | + } |
| 31 | + .el--8 { |
| 32 | + background-color: crimson; |
| 33 | + } |
34 | 34 |
|
35 | | - .container--1 { |
36 | | - /* STARTER */ |
37 | | - font-family: sans-serif; |
38 | | - background-color: #ddd; |
39 | | - font-size: 40px; |
40 | | - margin: 40px; |
| 35 | + .container--1 { |
| 36 | + /* STARTER */ |
| 37 | + font-family: sans-serif; |
| 38 | + background-color: #ddd; |
| 39 | + font-size: 40px; |
| 40 | + margin: 40px; |
41 | 41 |
|
42 | | - /* CSS GRID */ |
43 | | - } |
| 42 | + /* CSS GRID */ |
| 43 | + display: grid; |
| 44 | + grid-template-columns: 240px 240px 120px 120px; |
| 45 | + grid-template-rows: 300px 200px; |
44 | 46 |
|
45 | | - .container--2 { |
46 | | - /* STARTER */ |
47 | | - font-family: sans-serif; |
48 | | - background-color: black; |
49 | | - font-size: 40px; |
50 | | - margin: 100px; |
| 47 | + /* gap: 30px; */ |
| 48 | + column-gap: 30px; |
| 49 | + row-gap: 60px; |
| 50 | + } |
51 | 51 |
|
52 | | - width: 1000px; |
53 | | - height: 600px; |
| 52 | + .container--2 { |
| 53 | + display: none; |
54 | 54 |
|
55 | | - /* CSS GRID */ |
56 | | - } |
57 | | - </style> |
58 | | - </head> |
59 | | - <body> |
60 | | - <div class="container--1"> |
61 | | - <div class="el el--1">(1) HTML</div> |
62 | | - <div class="el el--2">(2) and</div> |
63 | | - <div class="el el--3">(3) CSS</div> |
64 | | - <div class="el el--4">(4) are</div> |
65 | | - <div class="el el--5">(5) amazing</div> |
66 | | - <div class="el el--6">(6) languages</div> |
67 | | - <div class="el el--7">(7) to</div> |
68 | | - <div class="el el--8">(8) learn</div> |
69 | | - </div> |
| 55 | + /* STARTER */ |
| 56 | + font-family: sans-serif; |
| 57 | + background-color: black; |
| 58 | + font-size: 40px; |
| 59 | + margin: 100px; |
70 | 60 |
|
71 | | - <div class="container--2"> |
72 | | - <div class="el el--1">(1)</div> |
73 | | - <div class="el el--3">(3)</div> |
74 | | - <div class="el el--4">(4)</div> |
75 | | - <div class="el el--5">(5)</div> |
76 | | - <div class="el el--6">(6)</div> |
77 | | - <div class="el el--7">(7)</div> |
78 | | - </div> |
79 | | - </body> |
| 61 | + width: 1000px; |
| 62 | + height: 600px; |
| 63 | + |
| 64 | + /* CSS GRID */ |
| 65 | + } |
| 66 | + </style> |
| 67 | + </head> |
| 68 | + <body> |
| 69 | + <div class="container--1"> |
| 70 | + <div class="el el--1">(1) HTML</div> |
| 71 | + <div class="el el--2">(2) and</div> |
| 72 | + <div class="el el--3">(3) CSS</div> |
| 73 | + <div class="el el--4">(4) are</div> |
| 74 | + <div class="el el--5">(5) amazing</div> |
| 75 | + <div class="el el--6">(6) languages</div> |
| 76 | + <div class="el el--7">(7) to</div> |
| 77 | + <div class="el el--8">(8) learn</div> |
| 78 | + </div> |
| 79 | + |
| 80 | + <div class="container--2"> |
| 81 | + <div class="el el--1">(1)</div> |
| 82 | + <div class="el el--3">(3)</div> |
| 83 | + <div class="el el--4">(4)</div> |
| 84 | + <div class="el el--5">(5)</div> |
| 85 | + <div class="el el--6">(6)</div> |
| 86 | + <div class="el el--7">(7)</div> |
| 87 | + </div> |
| 88 | + </body> |
80 | 89 | </html> |
0 commit comments