-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
95 lines (76 loc) · 2.93 KB
/
index.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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Document</title>
<link href="https://fonts.googleapis.com/css?family=Lato" rel="stylesheet">
<link rel="stylesheet" href="css/styles.css">
</head>
<body>
<h1>Desvendando o CSS-GRID</h1>
<section>
<p>O Grid do CSS é uma técnica que permite criar layouts responsivos por meio do alinhamento de conteúdos e elementos em uma página HTML.<br><br> Ele utiliza o método de linhas e colunas, onde podemos até definir regiões onde nossos elementos estarão na página. De início é importante manter em mente que o significado de dois termos:</p>
Justify: utilizamos para alinhamento horizontal (eixo x).<br>
Align: utilizamos para alinhamento vertical (eixo y).
</section>
<section>
<h2>Alinhamento de Itens</h2>
<p>Aqui estamos utilizando um grid com 3 linhas em 3 colunas, onde cada todos os item são alinhados juntos, nesse
caso, ao centro de sua respectiva célula.
<div class="container-1">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</section>
<section>
<h2>Alinhamento Self</h2>
<p>Aqui temos um grid também com 3 linhas e 3 colunas, mas podemos trabalhar individualmente no alinhamento de itens. Basta setar o 'align/justify-self' no elemento filho do container que eu quero alinhar. No exemplo abaixo, os items em verde estão recebendo a classe 'center' que contém os alinhamnetos ao centro. </p>
<div class="container-2">
<div></div>
<div class="center"></div>
<div></div>
<div></div>
<div class="center"></div>
<div></div>
<div></div>
<div class="center"></div>
<div></div>
</div>
</section>
<section>
<h2>Alinhamento de Content</h2>
<p>Aqui temos um grid também com 3 linhas e 3 colunas, mas podemos trabalhar no alinhamento do próprio grid, utilizando o 'justify/align-content'.</p>
<p>O uso dessas propriedades são raras, pois só é aplicado caso o grid seja menor que a area definida. (Por exemplo, quando usamos em px o tamanho do grid, poderemos terminar com um grid pequeno, para o tamanho da area do grid)</p>
<div class="container-3">
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
<div></div>
</div>
</section>
<section>
<h2>Alinhamento por Template</h2>
<p>Por meio do grid-template-areas podemos alinhar os elementos onde quisermos dentro de um container.</p>
<div class="container-4">
<header>Header</header>
<main>Main Content</main>
<aside>Aside</aside>
<footer>Footer</footer>
</div>
</section>
</body>
</html>