-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflex-shrink-grow.html
61 lines (60 loc) · 1.14 KB
/
flex-shrink-grow.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
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='UTF-8'>
<title></title>
<style>
body {
margin: 0;
padding: 0;
}
.container {
margin: 0;
height: calc(100vh - 20px);
width: calc(100vw - 20px);
border: 10px solid red;
display: flex;
justify-content: center;
align-items: center;
}
.blocks {
display: flex;
justify-content: center;
align-items: center;
width: 1000px
}
.block {
background-color:cadetblue;
height: 200px;
margin: 20px;
display: flex;
justify-content: center;
align-items: center;
}
.block1 {
flex-basis: 400px;
/* flex-grow: 4; */
flex-shrink: 2;
}
.block2 {
flex-basis: 100px;
/* flex-grow: 1; */
flex-shrink: 1;
}
.block3 {
flex-basis: 200px;
/* flex-grow: 2; */
flex-shrink: 1;
}
</style>
</head>
<body>
<div class="container">
<div class="blocks">
<div class="block block1">1</div>
<div class="block block2">2</div>
<div class="block block3">3</div>
</div>
</div>
</body>
</html>