-
Notifications
You must be signed in to change notification settings - Fork 0
/
parte-3.html
62 lines (59 loc) · 1.43 KB
/
parte-3.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
<!-- Este é o código da parte 3 da série de Grid Layout do blog Oh My Code. -->
<!-- Acesse: ohmycode.com.br -->
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<title>Grid Layout - Parte 3</title>
<style>
*{
margin: 0;
font-family: arial;
}
.color-1{
background-color: #1C35CF;
}
.color-2{
background-color: #8A33FA;
}
.color-3{
background-color: #BD43C0;
}
.color-4{
background-color: #DD375B;
}
.color-5{
background-color: #1A9541;
}
.color-6{
background-color: #D44024;
}
.grid{
display: grid;
/*para deixar uma coluna de largura fixa*/
/*grid-template-columns: 100px repeat(3, 2fr);*/
/*para intercalar entre as larguras das colunas*/
/*grid-template-columns: 100px repeat(3, 2fr 1fr);*/
/*também funciona em grid-template-rows*/
/*grid-template-rows: repeat(5, 200px);*/
grid-template-columns: repeat(4, 2fr);
grid-template-rows: 100px 250px;
grid-gap: 10px;
}
.grid-item{
color: white;
padding: 20px;
}
</style>
</head>
<body>
<div class="grid">
<div class="grid-item color-1">1</div>
<div class="grid-item color-2">2</div>
<div class="grid-item color-3">3</div>
<div class="grid-item color-4">4</div>
<div class="grid-item color-5">5</div>
<div class="grid-item color-6">6</div>
</div>
</body>
</html>