-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathNa pratica com flex.html
68 lines (60 loc) · 1.62 KB
/
Na pratica com flex.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Fundamentos flex</title>
<style>
.flex-container {
display: flex;
border: 1px solid black;
max-width: 400px;
}
.item {
background-color: brown;
color: white;
font-size: 24px;
text-align: center;
margin: 5px;
}
.flex-1 {
flex: 1;
/* grow = 1 shrink = 1, basis = 0 */
}
.flex-2 {
flex: 2;
/* grow = 2 shrink = 1, basis = 0 */
}
.flex-3 {
flex: 3;
/* grow = 2 shrink = 1, basis = 0 */
}
</style>
</head>
<body>
<p>flex: 1</p>
<div class="flex-container">
<div class="item flex-1">A</div>
<div class="item flex-1">BBB</div>
<div class="item flex-1">CC</div>
<div class="item flex-1">D</div>
<div class="item flex-1">EF</div>
</div>
<p>flex: mix</p>
<div class="flex-container">
<div class="item flex-1">A</div>
<div class="item flex-2">BBB</div>
<div class="item flex-2">CC</div>
<div class="item flex-1">D</div>
<div class="item flex-1">EF</div>
</div>
<p>flex: 3</p>
<div class="flex-container">
<div class="item flex-1">A</div>
<div class="item flex-2">BBB</div>
<div class="item flex-3">CC</div>
<div class="item flex-2">D</div>
<div class="item flex-1">EF</div>
</div>
</body>
</html>