-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstyle.css
More file actions
61 lines (49 loc) · 1.33 KB
/
style.css
File metadata and controls
61 lines (49 loc) · 1.33 KB
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
/*
- flex-direction: row é usado por padrão no display: flex
- flex-direction: column faz com que o elemento se torne uma coluna
*/
section.flex {
display: flex;
justify-content: space-around;
height: 500px;
}
section.flex>div {
align-self: center;
min-width: 200px;
min-height: 200px;
border: 1px solid #ccc;
margin: 10px;
}
/* - Esticar o primeiro elemento */
section.flex>*:first-child {
align-self: stretch;
}
/* - Alinhar quarto elemento ao final da div */
section.flex>div:nth-child(4) {
align-self: flex-end;
}
/*
EXEMPLOS PARA USAR O CHILD
- Posso usar div:first-child para selecionar o primeiro elemento
- div:nth-child(n+2) faz com que a formatação pegue a partir do segundo elemento
- div:nth-child(4) a formatação pega apenas no quarto item
- div:nth-child(1n+3) formata o primeiro elemento e o elemento a partir do terceiro
- div:nth-child(0n+3) mesma coisa de se utilizar (n+3)
*/
section.flex>div:nth-child(n+3) {
display: flex;
justify-content: center;
/*
OU
- text-align: center
*/
}
/*
MEDIA QUERIES
- Se a resolução atingir esse breakpoint, a section quebrará automaticamente, alinhando da melhor forma os elementos em tela
*/
@media (max-width: 800px) {
section.flex {
flex-wrap: wrap;
}
}