summaryrefslogtreecommitdiff
path: root/Base/res/html/misc/flex.html
blob: 3a6179215f3ae600cfd4f063831dbe016676d6bf (plain)
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
<!DOCTYPE html>
<html>

<head>
    <title>Flex</title>
    <style>
        .my-container {
            display: flex;
            border: 1px solid salmon;
        }

        .width-constrained {
            width: 250px;
        }

        .height-constrained {
            height: 250px;
        }

        .column {
            flex-direction: column;
        }

        .box {
            width: 100px;
            height: 100px;
            border: 1px solid black;
        }
    </style>
</head>

<body>
    <h1>FlexBox Tests</h1>
    <p>The boxes are width and height 100px.</p>
    <h2>Row</h2>
    <h3>Width unconstrained</h3>
    <p>Default</p>
    <div class="my-container">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <h3>Width 250px</h3>
    <p>Default</p>
    <div class="my-container width-constrained">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>Flex-wrap: nowrap</p>
    <div class="my-container width-constrained" style="flex-wrap: nowrap;">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>Flex-wrap: wrap</p>
    <div class="my-container width-constrained" style="flex-wrap: wrap;">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>Flex-wrap: wrap-reverse</p>
    <div class="my-container width-constrained" style="flex-wrap: wrap-reverse;">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>

    <h4>Flex-flow shorthand</h4>

    <p>flex-flow: row nowrap;</p>
    <div class="my-container width-constrained" style="flex-flow: row nowrap;">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>

    <p>flex-flow: row wrap;</p>
    <div class="my-container width-constrained" style="flex-flow: row wrap;">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>

    <h2>Column</h2>
    <h3>Height/Width unconstrained</h3>
    <p>Default</p>
    <div class="my-container column">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <h3>Height 250px</h3>
    <p>Default</p>
    <div class="my-container column height-constrained">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <h4>Also Width 250px</h4>
    <p>Default</p>
    <div class="my-container width-constrained column height-constrained">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>Flex-wrap: nowrap</p>
    <div class="my-container column width-constrained height-constrained" style="flex-wrap: nowrap;">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>Flex-wrap: wrap</p>
    <div class="my-container column width-constrained height-constrained" style="flex-wrap: wrap;">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>
    <p>Flex-wrap: wrap-reverse</p>
    <div class="my-container column width-constrained height-constrained" style="flex-wrap: wrap-reverse;">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>

    <h4>Flex-flow shorthand</h4>

    <p>flex-flow: column nowrap;</p>
    <div class="my-container width-constrained height-constrained" style="flex-flow: column nowrap;">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>

    <p>flex-flow: column wrap;</p>
    <div class="my-container width-constrained height-constrained" style="flex-flow: column wrap;">
        <div class="box">1</div>
        <div class="box">2</div>
        <div class="box">3</div>
    </div>

    <h2>Grow/Shrink</h2>
    <p>Container has width of 500px</p>
    <p>flex-grow: 4/2/0</p>
    <div class="my-container" style="flex-flow: row nowrap; width: 500px;">
        <div class="box" style="flex-grow: 4;">1 I grow the most</div>
        <div class="box" style="flex-grow: 2;">2 I grow</div>
        <div class="box" style="flex-grow: 0;">3 I don't</div>
    </div>
    <p>Container has width of 250px</p>
    <p>flex-shrink: 4/1/0</p>
    <div class="my-container" style="flex-flow: row nowrap; width: 250px;">
        <div class="box" style="flex-shrink: 4;">1 I shrink the most</div>
        <div class="box" style="flex-shrink: 1;">2 I shrink</div>
        <div class="box" style="flex-shrink: 0;">3 I don't</div>
    </div>

    <h2>Flex shorthand</h2>
    <p>flex: initial;</p>
    <div class="my-container" style="width: 500px;">
        <div class="box" style="flex: initial;">1</div>
        <div class="box" style="flex: initial;">2</div>
        <div class="box" style="flex: initial;">3</div>
    </div>
    <p>flex: auto;</p>
    <div class="my-container" style="width: 500px;">
        <div class="box" style="flex: auto;">1</div>
        <div class="box" style="flex: auto;">2</div>
        <div class="box" style="flex: auto;">3</div>
    </div>
    <p>flex: none;</p>
    <div class="my-container" style="width: 500px;">
        <div class="box" style="flex: none;">1</div>
        <div class="box" style="flex: none;">2</div>
        <div class="box" style="flex: none;">3</div>
    </div>
    <p>flex: 1/2/3;</p>
    <div class="my-container" style="width: 500px;">
        <div class="box" style="flex: 1;">1</div>
        <div class="box" style="flex: 2;">2</div>
        <div class="box" style="flex: 3;">3</div>
    </div>
    <p>flex: 0 0 0;</p>
    <div class="my-container" style="width: 500px;">
        <div class="box" style="flex: 0 0 0;">1</div>
        <div class="box" style="flex: 0 0 0;">2</div>
        <div class="box" style="flex: 0 0 0;">3</div>
    </div>
    <p>flex: 0 0 0; flex-direction: column;</p>
    <div class="my-container column" style="width: 500px;">
        <div class="box" style="flex: 0 0 0;">1</div>
        <div class="box" style="flex: 0 0 0;">2</div>
        <div class="box" style="flex: 0 0 0;">3</div>
    </div>
    <p>flex: 1 2 0;</p>
    <div class="my-container" style="width: 500px;">
        <div class="box" style="flex: 1 2 0;">1</div>
        <div class="box" style="flex: 1 2 0;">2</div>
        <div class="box" style="flex: 1 2 0;">3</div>
    </div>
    <p>flex: 0 1 2; <span style="color: red;">(Invalid)</span></p>
    <div class="my-container" style="width: 500px;">
        <div class="box" style="flex: 0 1 2;">1</div>
        <div class="box" style="flex: 0 1 2;">2</div>
        <div class="box" style="flex: 0 1 2;">3</div>
    </div>
    <p>flex: 4/1/0 0 50px;</p>
    <div class="my-container" style="width: 500px;">
        <div class="box" style="flex: 4 0 50px;">1</div>
        <div class="box" style="flex: 1 0 50px;">2</div>
        <div class="box" style="flex: 0 0 50px;">3</div>
    </div>
    <p>flex: 80% 0 4/1/0;</p>
    <div class="my-container" style="width: 500px;">
        <div class="box" style="flex: 80% 0 4;">1</div>
        <div class="box" style="flex: 80% 0 1;">2</div>
        <div class="box" style="flex: 80% 0 0;">3</div>
    </div>
    <p>flex: auto 0 4/1/0;</p>
    <div class="my-container" style="width: 500px;">
        <div class="box" style="flex: auto 0 4;">1</div>
        <div class="box" style="flex: auto 0 1;">2</div>
        <div class="box" style="flex: auto 0 0;">3</div>
    </div>
</body>

</html>