-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathflexgrow.html
executable file
·53 lines (46 loc) · 1.66 KB
/
flexgrow.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
<html>
<head>
<title>Flexbox Grids</title>
<link rel="stylesheet" href="css/showcase.css">
<link rel="stylesheet" href="css/flexgrow.css">
<link href="https://fonts.googleapis.com/css?family=Ubuntu:300" rel="stylesheet">
</head>
<body>
<h2>Property: <code>flex-grow</code></h2>
<p>Default: <code>flex-grow: 0</code> (remaining space not filled)</p>
<div class="container">
<div>1 <br>flex-grow: 0</div>
<div>2 <br>flex-grow: 0</div>
<div>3 <br>flex-grow: 0</div>
<div>4 <br>flex-grow: 0</div>
</div>
<p>3 allowed to take remaining space (<code>flex-grow: 1</code>)</p>
<div class="grow1 container">
<div>1 <br>flex-grow: 0</div>
<div>2 <br>flex-grow: 0</div>
<div>3 <br>flex-grow: 1</div>
<div>4 <br>flex-grow: 0</div>
</div>
<p>Remaining space distributed equally (all have same <code>flex-grow</code>)</p>
<div class="grow2 container">
<div>1 <br>flex-grow: 1</div>
<div>2 <br>flex-grow: 1</div>
<div>3 <br>flex-grow: 1</div>
<div>4 <br>flex-grow: 1</div>
</div>
<p>3 gets 2/5 (40%) of remaining space (does not mean that 3 will be twice as wide)</p>
<div class="grow3 container">
<div>1 <br>flex-grow: 1</div>
<div>2 <br>flex-grow: 1</div>
<div>3 <br>flex-grow: 2</div>
<div>4 <br>flex-grow: 1</div>
</div>
<p>3 gets 4/7 of remaining space</p>
<div class="grow4 container">
<div>1 <br>flex-grow: 1</div>
<div>2 <br>flex-grow: 1</div>
<div>3 <br>flex-grow: 4</div>
<div>4 <br>flex-grow: 1</div>
</div>
</body>
</html>