forked from w3c/csswg-drafts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOverview.src.html
More file actions
916 lines (665 loc) · 49.3 KB
/
Overview.src.html
File metadata and controls
916 lines (665 loc) · 49.3 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
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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>CSS Flexible Box Layout Module</title>
<link rel="stylesheet" type="text/css" href="http://dev.w3.org/csswg/css-module/default.css">
<link rel="stylesheet" type="text/css" href="http://www.w3.org/StyleSheets/TR/W3C-ED">
</head><body>
<div class="head">
<!--logo-->
<h1 id="head-box-flexible">CSS Flexible Box Layout Module</h1>
<h2 class="no-num no-toc" id="w3c-working">[LONGSTATUS], [DATE]</h2>
<dl>
<dt>This version:
<dd><!-- <a href="http://www.w3.org/TR/[YEAR]/WD-[SHORTNAME]-[CDATE]/">http://www.w3.org/TR/[YEAR]/WD-[SHORTNAME]-[CDATE]/</a></dd> -->
<a href="http://dev.w3.org/csswg/[SHORTNAME]/">http://dev.w3.org/csswg/[SHORTNAME]/</a>
<dt>Latest version:
<dd><a href="http://www.w3.org/TR/css3-flexbox/">http://www.w3.org/TR/css3-flexbox/</a>
<dt>Previous version:
<dd><a href="http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/">http://www.w3.org/TR/2009/WD-css3-flexbox-20090723/</a>
<dt>Editors:
<dd><a href="http://www.xanthir.com/contact">Tab Atkins Jr.</a>, Google Inc.</dd>
<dd>Alex Mogilevsky, Microsoft Corporation, <a href="mailto:alexmog@microsoft.com">alexmog@microsoft.com</a>
<dd>L. David Baron, Mozilla Corporation, <a href="mailto:dbaron@dbaron.org">dbaron@dbaron.org</a>
<dt>Authors and former editors:
<dd>Neil Deakin, Mozilla Corporation, <a href="mailto:enndeakin@gmail.com">enndeakin@gmail.com</a>
<dd>Ian Hickson, formerly of Opera Software, <a href="mailto:ian@hixie.ch">ian@hixie.ch</a>
<dd>David Hyatt, formerly of Netscape Corporation, <a href="mailto:hyatt@apple.com">hyatt@apple.com</a>
</dl>
<!--copyright-->
<hr title="Separator for header">
</div>
<p style="border: thick solid red; background: #fdd; color: red; font-weight: bold; padding: .5em; position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; margin: 1em;">This draft is in heavy flux right now while I perform a major editorial rewrite and fix issues that were raised in the past few months. Do not rely on any detail in this draft while this notice is present. I expect to finish the rewrite by Sep 2 2011.</p>
<h2 class="no-num no-toc" id="abstract">
Abstract</h2>
<p>The specification describes a CSS box model optimized for user interface design. In flexbox layout model, the children of a box are laid out either horizontally or vertically, and unused space can be assigned to a particular child or distributed among the children by assignment of "flex" to the children that should expand. Nesting of these boxes (horizontal inside vertical, or vertical inside horizontal) can be used to build layouts in two dimensions.</p>
<h2 class="no-num no-toc" id="status">Status of this document</h2>
<!--status-->
<h2 class="no-num no-toc" id="table">Table of contents</h2>
<!--toc-->
<h2 id="intro">
Introduction</h2>
<p>CSS 2.1 defined four layout modes — algorithms which determine the size and position of boxes based on their relationships with their sibling and ancestor boxes: block layout, designed for laying out documents and simple applications; inline layout, designed for laying out text; table layout, designed for laying out information in a tabular format; and positioned layout, designed for very explicit positioning without much regard for other elements in the document. This module introduces a new layout mode, flexbox layout, which is designed for laying out more complex applications and webpages.</p>
<p>Flexbox layout is superficially similar to block layout. It lacks many of the more complex text or document-formatting properties that can be used in block layout, such as 'float' and 'columns', but in return it gains more simple and powerful tools for aligning its contents in ways that webapps and complex web pages often need. </p>
<p>The contents of a flexbox can be laid out in any direction, can have their order swapped around dynamically, and can "flex" their sizes and positions to respond to the available space. If a flexbox is <i>multi-line</i>, the flexbox items flow in two dimensions, wrapping into separate lines in a fashion similar to how text is wrapped into multiple lines. The direction that these lines are stacked in can also be controlled explicitly, relative either to the current writing mode (logical directions) or explicit physical directions.</p>
<h2 id='box-model'>
The Flexbox Box Model</h2>
<p>An element with ''display:flexbox'' or ''display:inline-flexbox'' is a <dfn>flexbox</dfn>. Block-level children of a flexbox, and some other types of children, are called <dfn title="flexbox item|flexbox items|flexbox item's" id="flexbox-item">flexbox items</dfn> and are laid out using the flexbox box model. <span class='note'>(See the <a href="#flex-items">Flexbox Items</a> chapter, below, for specifics on which children are <i>flexbox items</i> directly and which children are instead wrapped in anonymous boxes which are then <i>flexbox items</i>)</span></p>
<p>The flexbox layout algorithm works is agnostic as to the physical direction the flexbox happens to be laid out in, so we will define several direction-agnostic terms here to make the rest of the spec easier to read and understand. The <dfn>main axis</dfn> of a flexbox is the axis on which <i>flexbox items</i> are laid out along. The <i>flexbox items</i> are ordered such that they start on the <dfn>main-start</dfn> side of the flexbox, and go toward the <dfn>main-end</dfn> side. A <i>flexbox item's</i> width or height, whichever is in the <i>main axis</i>, is the item's <dfn>main size</dfn>. The <i>flexbox item's</i> 'width' or 'height' property, specifically, that is in the <i>main axis</i> is the item's <dfn>main size property</dfn>. These terms are mapped to physical directions based on the first keyword in the 'flex-flow' property.</p>
<p>The axis perpendicular to the <i>main axis</i> is called the <dfn>cross axis</dfn>, and similarly has <dfn>cross-start</dfn> and <dfn>cross-end</dfn> directions and sides defined. The width or height of a <i>flexbox item</i>, whichever is in the <i>cross axis</i>, is the item's <dfn>cross size</dfn>, and similarly the actual 'width' or 'height' property, whichever is in the <i>cross axis</i>, is the item's <dfn>cross size property</dfn>. These terms are mapped to physical directions based on the orientation of the <i>main axis</i> and the second keyword in the 'flex-flow' property.</p>
<p>The contents of a flexbox can be easily and powerfully manipulated with a handful of properties. Most significantly, <i>flexbox items</i> can "flex" their <i>main size</i> by using the ''flex()'' function in the 'width' or 'height' property. This "flexing" allows the items to get bigger or smaller based on the available space in the page. If there is leftover space in the flexbox after all of the <i>flexbox items</i> have finished flexing, the items can be aligned, centered, or distributed with the 'flex-pack' property. <i>Flexbox items</i> can also be completely rearranged within the flexbox with the 'flex-order' property.</p>
<p>In the <i>cross axis</i>, <i>flexbox items</i> can either "flex" to fill the available space or be aligned within the space with the 'flex-align' property. If a flexbox is <i>multi-line</i>, new lines are added in the <i>cross-end</i> direction, and can similarly be aligned, centered, or distributed within the flexbox with the 'flex-line-pack' property.</p>
<p>Similar to other layout modes such as table layout, a flexbox acts like a block when placed into elements using other layout modes. Inline flexboxes act like inline-blocks.</p>
<div class="example">
<p>For example, the following HTML snippet declares a flexbox with a few children. The flexbox is horizontal, and the children's widths don't fill the flexbox's width, so the additional space is distributed between the children. The flexbox's height isn't explicitly specified, so it shrinks to the height of its tallest child and centers the other children within it:</p>
<pre>
<p style="width: 500px; padding: 5px; display: flexbox; flex-pack: distribute; flex-align: middle;">
<button style="width: 200px;">Child 1<br>Another Line</button>
<button style="width: 100px;">Child 2</button>
<button style="width: 100px;">Child 3</button>
</p></pre>
<p>This will render approximately like the following:</p>
<p style="border: thin solid black; background: white; width: 500px; padding: 5px; overflow: hidden;">
<button style="float: left; width: 200px; height: 40px; margin-right: 50px;">Child 1<br>Another Line</button>
<button style="float: left; width: 100px; height: 22px; margin-top: 9px;">Child 2</button>
<button style="float: right; width: 100px; height: 22px; margin-top: 9px;">Child 3</button>
</p>
</div>
<h3 id='display-flexbox'>
New values for 'display' property</h3>
<table class="propdef">
<tr>
<th>Name:
<td>display
<tr>
<th>New value:
<td>flexbox | inline-flexbox
</table>
<p>You can declare that an element is a flexbox, and thus should use flexbox layout for its contents, by setting the 'display' property on the element to the value 'flexbox' or 'inline-flexbox'.</p>
<p>The ''flexbox'' value makes the flexbox act like a block in other layout modes. The ''inline-flexbox'' value makes the flexbox act like an inline-block in other layout modes.</p>
<p>Setting ''display:flexbox'' on an element forces it to use a new layout algorithm, and so some properties that were designed with the assumption of block layout don't make sense in a flexbox context. In particular:</p>
<ul>
<li>all of the 'column-*' properties in the Multicol module compute to their initial values on a flexbox ('break-before', 'break-inside', and 'break-after' are still valid on a flexbox).</li>
<li>'float' and 'clear' compute to their initial values on a flexbox item</li>
<li>'vertical-align' has no effect on a flexbox item</li>
</ul>
<p>A flexbox item creates a new flexbox formatting context for its contents. This is similar to a block formatting context: floats must not intrude into the flexbox, and the flexbox's margins do not collapse with any other margin. Additionally, all of the <i>flexbox items</i> establish new block formatting contexts for their contents.</p>
<p class='issue'>Figure out the right terms to use here.</p>
<h3 id='flex-items'>
Flexbox Items</h3>
<p>Flexbox layout algorithm operates on <i>flexbox items</i>, which are boxes that satisfy at least one of the following criteria:</p>
<ol>
<li>Immediate block-level children of flexbox</li>
<li>Atomic inline-level children of flexbox</li>
<li>Contiguous run of non-replaced inline children, wrapped into an anonymous block</li>
</ol>
<div class="example">
<p>Examples of flexbox items:</p>
<pre>
<div style="display:flexbox">
<!-- flexbox item: block-level child -->
<div id="item1">block</div>
<!-- not a flexbox item, because it's out-of-flow -->
<div id="not-an-item1.5" style="position: absolute;">block</div>
<!-- flexbox item: block-level child -->
<div id="item2" style="display:table">table</div>
<!-- flexbox item: anonymous table wrapped around table-cell -->
<div id="item3" style="display:table-cell">table-cell</div>
<!-- flexbox item: anonymous block around inline content -->
anonymous item 4
<!-- flexbox item: block-level child -->
<div id="item5">block</div>
<!-- flexbox item: anonymous block around inline content -->
anonymous item 6.1
<span id="item6.1">
text 6.2
<div id="not-an-item6.3">block</div>
text 6.4
</span>
<!-- flexbox item: block-level replaced element -->
<iframe id="item7"></iframe>
<!-- flexbox item: inline-level replaced element -->
<img id="item7" style="display:inline">
<!-- flexbox item: inline-level replaced element -->
<button id="item8">button</button>
<!-- flexbox item: inline-table -->
<div id="item9" style="display:inline-table">table</div>
</div></pre>
<p>Notice that block element "not-an-item6.3" is not a separate flexbox item, because it is contained inside an inline element which is being wrapped into an anonymous flex item. Similarly, the block element "not-an-item1.5" is not a flexbox item, because it's absolutely positioned and thus out of flow.</p>
</div>
<p>Absolutely positioned children of a flexbox are not <i>flexbox items</i>, but their "static position" (their position when the 'top'/'right'/'bottom'/'left' properties are ''auto'') responds somewhat to the flexbox's various properties. The element's static position in the flexbox's <i>cross axis</i> is on the <i>cross-start</i> edge of the flexbox's content box. The static position in the flexbox's <i>main axis</i> is slightly more complex to compute:</p>
<p>First, find the element's <dfn>hypothetical neighbors</dfn> by assuming that the element is a normal <i>flexbox item</i> with ''flex-order:1'', and reorder the flexbox's contents as mandated by 'flex-order'. The <i>flexbox items</i> immediately preceding and following (in the flexbox's direction) the element (if any) are the element's <i>hypothetical neighbors</i>.</p>
<p>If the element has two neighbors, its static position in the <i>main axis</i> is exactly in the center of the packing space between them when the flexbox is actually laid out. If the element has only a preceding neighbor, its static position in the <i>main axis</i> is flush with the <i>main-end</i> edge of the margin box of the neighbor. If the element has only a following neighbor, its static position in the <i>main axis</i> is flush with the <i>main-start</i> edge of the margin box of the neighbor. Finally, if the element has no neighbors (the flexbox has no in-flow children at all), the static position in the <i>main axis</i> is based on the value of 'flex-pack': if the value is ''start'' or ''distribute'', it's flush with the <i>main-start</i> edge of the flexbox's content box; if the value is ''end'', it's flush with the <i>main-end</i> edge of the flexbox's content box; if the value is ''center'', it's centered within the flexbox's content box.</p>
<h2 id='ordering-orientation'>
Ordering and Orientation</h2>
<p>The first level of flexbox functionality is the ability to lay out a flexbox's contents in any direction and in any order. This allows an author to trivially achieve effects that would previously have required complex or fragile methods, such as using the 'float' property to lay out a horizontal navigation bar (which then requires further effort with the 'clear' property or others to make the elements interact nicely with the rest of the page). This functionality is exposed through the 'flex-flow' and 'flex-order' properties.</p>
<h3 id='flex-flow'>
Flexbox Flow Direction: the 'flex-flow' property</h3>
<table class=propdef>
<tbody>
<tr>
<th>Name:</th>
<td><dfn>flex-flow</dfn></td>
<tr>
<th>Values:
<td><pre> [ row | row-reverse | column | column-reverse ]
[ wrap | wrap-reverse ]?
|
[ horizontal | horizontal-reverse | horizontal-ltr | horizontal-rtl ]
[ wrap | wrap-reverse | wrap-down | wrap-up ]?
|
[ vertical | vertical-reverse | vertical-ttb | vertical-btt ]
[ wrap | wrap-reverse | wrap-left | wrap-right ]?</pre></td>
<tr>
<th>Initial:
<td>row</td>
</tr>
<tr>
<th>Applies To:
<td>flexboxes</td>
</tr>
<tr>
<th>Inherited:
<td>no</td>
</tr>
<tr>
<th>Computed Value:
<td>specified value</td>
</tr>
<tr>
<th>Media:
<td>visual</td>
</tr>
</tbody>
</table>
<p>The 'flexbox-flow' property specifies how <i>flexbox items</i> are placed in the flexbox. The value consists of one or two keywords: the first sets the orientation and direction of the flexbox's <i>main axis</i>, while the second, if specified, marks the flexbox as being multiline and sets the direction in which new lines are stacked.</p>
<p>The main directions affect how <i>flexbox items</i> are arranged, and how they respond to the 'flex-pack' property. They can be set with either logical directions (relative to the writing mode) or physical directions:</p>
<dl>
<dt>Logical Directions</dt>
<dd>
<dl>
<dt><dfn id='flex-flow-row'>row</dfn></dt>
<dd>The flexbox's <i>main axis</i> has the same orientation as the inline axis of the current writing mode (the direction that text is laid out in). The <i>main-start</i> and <i>main-end</i> directions are equivalent to the "start" and "end" directions, respectively, of the current writing mode.</dd>
<dt><dfn id='flex-flow-row-reverse'>row-reverse</dfn></dt>
<dd>Same as <i>row</i>, except the <i>main-start</i> and <i>main-end</i> directions are swapped.</dd>
<dt><dfn id='flex-flow-column'>column</dfn></dt>
<dd>The flexbox's <i>main axis</i> has the same orientation as the block axis of the current writing mode (the direction that blocks are laid out in). The <i>main-start</i> and <i>main-end</i> directions are equivalent to the "before" and "after" directions, respectively, of the current writing mode.</dd>
<dt><dfn id='flex-flow-column-reverse'>column-reverse</dfn></dt>
<dd>Same as <i>column</i>, except the <i>main-start</i> and <i>main-end</i> directions are swapped.</dd>
</dl>
</dd>
<dt>Physical Directions</dt>
<dd>
<dl>
<dt><dfn id='flex-flow-horizontal'>horizontal</dfn></dt>
<dd>The flexbox's <i>main axis</i> is horizontal. The <i>main-start</i> direction is equivalent to either the "start" or "before" direction of the current writing mode, whichever is vertical, and the <i>main-end</i> direction is the opposite direction of <i>main-start</i>.</dd>
<dt><dfn id='flex-flow-horizontal-reverse'>horizontal-reverse</dfn></dt>
<dd>Same as <i>horizontal</i>, except the <i>main-start</i> and <i>main-end</i> directions are swapped.</dd>
<dt><dfn id='flex-flow-horizontal-ltr'>horizontal-ltr</dfn></dt>
<dd>Same as <i>horizontal</i>, except the <i>main-start</i> direction is to the left and the <i>main-end</i> direction is to the right.</dd>
<dt><dfn id='flex-flow-horizontal-rtl'>horizontal-rtl</dfn></dt>
<dd>Same as <i>horizontal</i>, except the <i>main-start</i> direction is to the right and the <i>main-end</i> direction is to the left.</dd>
<dt><dfn id='flex-flow-vertical'>vertical</dfn></dt>
<dd>The flexbox's <i>main axis</i> is vertical. The <i>main-start</i> direction is equivalent to either the "start" or "before" direction of the current writing mode, whichever is horizontal, and the <i>main-end</i> direction is the opposite direction of <i>main-start</i>.</dd>
<dt><dfn id='flex-flow-vertical-reverse'>vertical-reverse</dfn></dt>
<dd>Same as <i>vertical</i>, except the <i>main-start</i> and <i>main-end</i> directions are swapped.</dd>
<dt><dfn id='flex-flow-vertical-ttb'>vertical-ttb</dfn></dt>
<dd>Same as <i>vertical</i>, except the <i>main-start</i> direction is upwards and the <i>main-end</i> direction is downwards.</dd>
<dt><dfn id='flex-flow-row-vertical-btt'>vertical-btt</dfn></dt>
<dd>Same as <i>vertical</i>, except the <i>main-start</i> direction is downwards and the <i>main-end</i> direction is upwards.</dd>
</dl>
</dd>
</dl>
<p class='note'>Usually, the logical keywords are sufficient, which is why their names are purposely short. For example, if the page's writing mode is lr-tb, like it is when the primary language is English, the ''row'' value makes the flexbox horizontal and going from left to right, while the ''column'' value makes the flexbox vertical and going from top to bottom. If this were specified as part of a page template, and the page as a whole was switched to a tb-rl writing-mode like what Japanese uses, the flexboxes would automatically shift to vertical and horizontal, respectively, which is often what is desired.</p>
<p>The <i>cross axis</i> is always perpendicular to the <i>main axis</i>. The second keyword, or the lack of it, sets the cross directions (<i>cross-start</i> and <i>cross-end</i>), and dictates whether the flexbox is single-line or multi-line. The cross directions affect how individual <i>flexbox items</i> respond to the 'flex-align' property, and the direction in which multiple lines are stacked and aligned by the 'flex-line-pack' property.</p>
<p>If the second keyword is omitted, the flexbox is single-line, the <i>cross-start</i> direction is equivalent to either the "start" or "before" direction of the current writing mode, whichever is in the <i>cross-axis</i>, and the <i>cross-end</i> direction is the opposite direction of <i>cross-start</i>.</p>
<p>If the second keyword is provided, the flexbox is <a href="#multiline">multi-line</a>. The <i>cross-start</i> and <i>cross-end</i> directions are set as follows:</p>
<dl>
<dt><dfn id='flex-flow-wrap'>wrap</dfn></dt>
<dd>The <i>cross-start</i> direction is equivalent to either the "start" or "before" direction of the current writing mode, whichever is in the <i>cross-axis</i>, and the <i>cross-end</i> direction is the opposite direction of <i>cross-start</i>.</dd>
<dt><dfn id='flex-flow-wrap-reverse'>wrap-reverse</dfn></dt>
<dd>Same as <i>wrap</i>, except the <i>cross-start</i> and <i>cross-end</i> directions are swapped.</dd>
<dt><dfn id='flex-flow-wrap-up'>wrap-up</dfn></dt>
<dd>The <i>cross-start</i> direction is downwards and the <i>cross-end</i> direction is upwards.</dd>
<dt><dfn id='flex-flow-wrap-right'>wrap-right</dfn></dt>
<dd>The <i>cross-start</i> direction is to the left and the <i>cross-end</i> direction is to the right.</dd>
<dt><dfn id='flex-flow-wrap-down'>wrap-down</dfn></dt>
<dd>The <i>cross-start</i> direction is upwards and the <i>cross-end</i> direction is downwards.</dd>
<dt><dfn id='flex-flow-wrap-left'>wrap-left</dfn></dt>
<dd>The <i>cross-start</i> direction is to the right and the <i>cross-end</i> direction is to the left.</dd>
</dl>
<p class='note'>Note that not all combinations of first and second keyword are allowed by the property's syntax, as they don't all make sense. For example, ''flex-flow: horizontal wrap-right'' is an invalid declaration.</p>
<div class="example">
<p>Some examples of valid flows:</p>
<pre>
div { flex-flow:row } /* initial value. Main axis is inline,
no wrap. */
div { flex-flow:horizontal-ltr wrap-down } /* main axis is horizontal, flow left-to-right,
wrap down */
div { writing-mode:tb-rl; /* main axis is vertical top-to-bottom (as line direction),
flex-flow:vertical wrap-reverse } /* cross axis is left-to-right (opposite to block direction) */</pre>
</div>
<h3 id='flex-order'>
Display Order: the 'flex-order' property</h3>
<p><i>Flexbox items</i> are, by default, displayed and laid out in the same order as they appear in the source document. The 'flex-order' property may be used to change this ordering.</p>
<table class=propdef>
<tr>
<th>Name:
<td><dfn>flex-order</dfn>
<tr>
<th>Value:
<td><integer>
<tr>
<th>Initial:
<td>1
<tr>
<th>Applies to:
<td><i>flexbox items</i></td>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Computed value:
<td>specified value
<tr>
<th>Media:
<td>visual
</table>
<p>The 'flex-order' property assigns <i>flexbox items</i> to ordinal groups.</p>
<p>Ordinal groups control the order in which <i>flexbox items</i> appear. A flexbox will lay out its content starting from the lowest numbered ordinal group and going up. Items with the same ordinal group are laid out in the order they appear in the source document.
<div class=example>
<p>This example shows how ordinal groups might be used.</p>
<pre><code> div { display: flexbox; }
#item1 { flex-order: 2; }
#item3 { flex-order: 2; }
#item4 { flex-order: 1; }
<div>
<div id="item1">item1</div>
<div id="item2">item2</div>
<div id="item3">item3</div>
<div id="item4">item4</div>
</div></code></pre>
<p>The first ordinal group, 1, contains item2 and item4. As item2 does not specify an ordinal group, it will default to 1. The elements will be displayed in document order, so item2 will be displayed before item4. The second ordinal group, 2, contains the remaining two items. The resulting display order will be:</p>
<pre><code>item2 item4 item1 item3</code></pre>
</div>
<p class='issue'>Add a realistic example of tab reordering.</p>
<p class='issue'>Add an example of reordering columns in a page.</p>
<h2 id='flexibility'>
Flexibility</h2>
<p>The defining aspect of flexbox layout is the ability to make the <i>flexbox items</i> "flex", altering their width or height to fill the available space. This is done by declaring a <dfn>flexible length</dfn> with the ''flex()'' function, defined below.</p>
<p>Flexible lengths are composed of a (non-flexible) preferred size and a positive and negative flexibility. If there's free space left over in the flexbox after subtracting the preferred sizes of all the <i>flexbox items</i>, it is divided up among the <i>flexbox items</i> proportionally to their positive flexibility, making their width larger so they fill the space. Conversely, if the flexbox's size is <em>less</em> than the sum of the preferred sizes, so that the items would overflow normally, the <i>flexbox items</i> are shrunk proportionally to their negative flexibility, again so they exactly fit in the space.</p>
<div class=example>
<p class=issue>TODO: Examples!</p>
</div>
<h3 id='flex-function'>
The ''flex()'' function</h3>
<p>The ''flex()'' function is used to specify the parameters of a <dfn title="flexible length|flexible lengths|flexible length's">flexible length</dfn>: the <dfn id="positive-flexibility" title="positive flexibility">positive</dfn> and <dfn>negative flexibility</dfn>, and the <dfn>preferred size</dfn>. The syntax of the ''flex()'' function is:</p>
<pre class=prod>flex( [ <pos-flex> <neg-flex>? ]? || <preferred-size>? )</pre>
<p><code><pos-flex></code> and <code><neg-flex></code> are non-negative <code><numbers>s</code>, while <code><preferred-size></code> is any value (other than another ''flex()'' function) that would be valid in the 'width' or 'height' property in which the function is used, except that zero lengths must not omit their unit.</p>
<p>The <code><pos-flex></code> component sets the length's <i>positive flexibility</i>; if omitted, the <i>positive flexibility</i> defaults to ''1''. The <code><neg-flex></code> component sets the length's <i>negative flexibility</i>; if omitted, it defaults to ''0''. The <code><preferred-size></code> component sets the length's <i>preferred size</i>; if omitted, it defaults to ''0px''.</p>
<p class='issue'>Examples!</p>
<h3 id='resolving-flexible-lengths'>
Resolving Flexible Lengths</h3>
<p><i>Flexible lengths</i> are resolved into normal, inflexible lengths by figuring out how large all of the <i>flexible lengths</i> in the flexbox <em>want</em> to be, then either adding or subtracting space from that preferred size. The following algorithm normatively describes how to do this conversion:</p>
<p>First, determine the width and height of the flexbox itself, as described by the <a href="#layout-interface">Box Properties</a> chapter. The <i>main size</i> of the flexbox's content box is the <i>available space</i>.</p>
<p>Second, if the flexbox is <i>multi-line</i>, break the contents across multiple lines, as described by the <a href="multiline">Multiline</a> chapter.</p>
<p>Then, for each line in the flexbox, do the following:</p>
<ol>
<li>Subtract the sum of the <i>pre-flex sizes</i> of the <i>flexbox items</i> on the line from the <i>available space</i>. This is the <dfn>free space</dfn>. This number may be negative, if the flexbox is single-line or a single <i>flexbox item</i> is larger than the entire flexbox.</li>
<li>
<dl>
<dt>If the <i>free space</i> is zero:</dt>
<dd>All <i>flexible lengths</i> resolve to their <i>preferred size</i>.</dd>
<dt>If the <i>free space</i> is positive:</dt>
<dd>
<p>Sum the <i>positive flexibility</i> of every <i>flexible length</i> on the line. This is the <dfn>total positive flexibility</dfn>.</p>
<p>For each <i>flexible length</i>, increment its <i>preferred size</i> by <code><i>free space</i> * <pos-flex> / <i>total positive flexibility</i></code>.</p>
</dd>
<dt>If the <i>free space</i> is negative:</dt>
<dd>
<p>Sum the <i>negative flexibility</i> of every <i>flexible length</i> on the line. This is the <dfn>total negative flexibility</dfn>.</p>
<p>For each <i>flexible length</i>, increment its <i>preferred size</i> by <code><i>free space</i> * <neg-flex> / <i>total negative flexibility</i></code>. <span class='note'>Note: since the free space is negative, incrementing the preferred size by this number makes the preferred size smaller.</span></p>
</dd>
</dl>
</li>
<li>
<p>Verify that min/max constraints aren't violated: for each <i>flexbox item</i> on the line with 'width'/'height' specified as a <i>flexible length</i>, if instead specifying the 'width'/'height' as the <i>preferred size</i> would cause the item to be in violation of its 'min/max-width/height' properties, resolve the <i>flexible length</i> to the smallest/largest length that would make it no longer in violation of those properties, as defined by <a href="http://www.w3.org/TR/CSS2/visudet.html#propdef-min-width">the algorithm in CSS2.1</a>.</p>
<p>If any <i>flexbox item</i> was found to be in violation by this step and resolved into an inflexible length, reset the <i>preferred size</i> of any remaining <i>flexible lengths</i> to their original values and restart this sub-algorithm.</p>
</li>
<li>Any remaining <i>flexible lengths</i> resolve to their <i>preferred size</i>.</li>
</ol>
<p>Once all <i>flexible lengths</i> have been resolved, the 'flex-pack', 'flex-align', and 'flex-line-pack' properties align the <i>flexbox items</i> and the flexbox's lines within the flexbox.</p>
<h2 id='alignment'>
Alignment</h2>
<p>After a flexbox's contents have finished their flexing, they can be aligned in both the <i>main axis</i> with 'flex-pack' and the <i>cross axis</i> with 'flex-align'. These properties make many common types of alignment trivial, including some things that were very difficult in CSS 2.1, like horizontal and vertical centering.</p>
<h3 id='flex-pack'>
Main Axis Alignment: the 'flex-pack' property</h3>
<table class=propdef>
<tr>
<th>Name:
<td><dfn>flex-pack</dfn>
<tr>
<th>Value:
<td>start | end | center | distribute
<tr>
<th>Initial:
<td>start
<tr>
<th>Applies to:
<td>flexboxes
<tr>
<th>Inherited:
<td>no
<tr>
<th>Computed Value:
<td>specified value
<tr>
<th>Media:
<td>visual
</table>
<p>The 'flex-pack' property aligns <i>flexbox items</i> in the <i>main axis</i> of the current line of the flexbox. This is done <em>after</em> any flexible lengths have been resolved. Typically it helps distribute extra free space leftover when either all the <i>flexbox items</i> on a line are inflexible, or are flexible but have reach their maximum size, but it also exerts some control over the alignment of items when they overflow the line.</p>
<dl>
<dt><dfn id='flex-pack-start'>start</dfn></dt>
<dd><i>Flexbox items</i> are packed toward the start of the line. The <i>main-start</i> margin edge of the first <i>flexbox item</i> on the line is placed flush with the <i>main-start</i> edge of the line, and each subsequent <i>flexbox item</i> is placed flush with the preceding item.</dd>
<dt><dfn id='flex-pack-end'>end</dfn></dt>
<dd><i>Flexbox items</i> are packed toward the end of the line. The <i>main-end</i> margin edge of the last <i>flexbox item</i> is placed flush with the <i>main-end</i> edge of the line, and each preceding <i>flexbox item</i> is placed flush with the subsequent item.</dd>
<dt><dfn id='flex-pack-center'>center</dfn></dt>
<dd><i>Flexbox items</i> are packed toward the center of the line. If the leftover free-space is negative, this value is identical to ''start''. Otherwise, the <i>flexbox items</i> on the line are placed flush with each other and aligned in the center of the line, with equal amounts of empty space between the <i>main-start</i> edge of the line and the first item on the line and between the <i>main-end</i> edge of the line and the last item on the line.</dd>
<dt><dfn id='flex-pack-distribute'>distribute</dfn></dt>
<dd><i>Flexbox items</i> are evenly distributed in the line. If the leftover free-space is negative or there is only a single <i>flexbox item</i> on the line, this value is identical to ''start''. Otherwise, the <i>main-start</i> margin edge of the first <i>flexbox item</i> on the line is placed flush with the <i>main-start</i> edge of the line, the <i>main-end</i> margin edge of the last <i>flexbox item</i> on the line is placed flush with the <i>main-end</i> edge of the line, and the remaining <i>flexbox items</i> on the line are distributed so that the empty space between any two adjacent items is the same.</dd>
</dl>
<div class=example>
<p class=issue>TODO: Examples showing the four values.</p>
</div>
<h3 id='flex-align'>
Cross Axis Alignment: the 'flex-align' property</h3>
<table class=propdef>
<tr>
<th>Name:
<td><dfn>flex-align</dfn>
<tr>
<th>Value:
<td>start | end | center | baseline | stretch
<tr>
<th>Initial:
<td>stretch
<tr>
<th>Applies to:
<td><i>flexbox items</i>
<tr>
<th>Inherited:
<td>no
<tr>
<th>Computed Value:
<td>specified value
<tr>
<th>Media:
<td>visual
</table>
<p>The 'flex-align' property aligns <i>flexbox items</i> in the <i>cross axis</i> of the current line of the flexbox, similar to 'flex-pack' but in the perpendicular axis. Note that 'flex-align' applies to individual <i>flexbox items</i>, while 'flex-pack' applies to the flexbox itself.</p>
<dl>
<dt><dfn id="flex-align-before">before</dfn></dt>
<dd>The <i>cross-start</i> margin edge of the <i>flexbox item</i> is placed flush with the <i>cross-start</i> edge of the line.</dd>
<dt><dfn id="flex-align-after">after</dfn></dt>
<dd>The <i>cross-end</i> margin edge of the <i>flexbox item</i> is placed flush with the <i>cross-end</i> edge of the line.</dd>
<dt><dfn id="flex-align-middle">middle</dfn></dt>
<dd>The <i>flexbox item's</i> margin box is centered in the <i>cross axis</i> within the line.</dd>
<dt><dfn id="flex-align-baseline">baseline</dfn></dt>
<dd>
<p>If the <i>flexbox item's</i> inline axis is the same as the <i>cross axis</i>, this value is identical to ''start''.</p>
<p>Otherwise, all <i>flexbox items</i> on the line with ''flex-align:baseline'' that don't run afoul of the previous paragraph are aligned such that their baselines align, and the item with the largest distance between its baseline and its <i>cross-start</i> margin edge is placed flush against the <i>cross-start</i> edge of the line.</p>
</dd>
<dt><dfn id="flex-align-stretch">stretch</dfn></dt>
<dd>
<p>If the <i>cross size property</i> of the <i>flexbox item</i> is anything other than ''auto'', this value is identical to ''start''.</p>
<p>Otherwise, this value causes the <i>cross size property</i> of the <i>flexbox item</i> to resolve to the length necessary to make the <i>cross size</i> of the item's margin box the same size as the line.</p>
</dd>
</dl>
<div class=example>
<p>By using a vertical flexbox and 'flex-align', we can emulate the functionality of HTML's <code><center></code> element:</p>
<pre><div>
<div>foo foo foo foo</div>
<div>bar bar<br>bar bar</div>
<div>foo foo foo foo foo foo foo foo foo foo foo foo</div>
</div>
<style>
div {
display: flexbox;
flex-flow: column;
width: 200px;
}
div > div {
flex-align: center;
}
</style></pre>
<p><img alt="" src="images/basic-vertical-flexbox.png"></p>
</div>
<p class='issue'>More examples for the other alignment values!</p>
<p>The precise effects of this property are articulated in the <a href="#layout-algorithm">Layout Algorithm</a> section.</p>
<h2 id='multiline'>
Multi-line flexbox</h2>
<p>A flexbox can be either single-line or multi-line, depending on the 'flex-flow' property. A <dfn>single-line</dfn> flexbox lays out all of its children in a single line, even if that would cause the flexbox to overflow its bounds. A <dfn>multi-line</dfn> flexbox breaks its <i>flexbox items</i> across multiple lines to avoid overflowing, similar to how text is broken onto a new line when it gets too wide to fit on the existing line. Every line contains at least one <i>flexbox item</i>, unless the flexbox itself is completely empty.</p>
<p>When additional lines are created, they are stacked in the flexbox in the <i>cross axis</i>. Each line is completely independent; flexible lengths and the 'flex-pack' and 'flex-align' properties only pay attention to the items on a single line at a time. The size of a line depends on the contents of the lines and the value of the 'flex-align' property. The lines are aligned within a flexbox with the 'flex-line-pack' property.</p>
<div class=example>
<p>This example shows four buttons that do not fit horizontally.</p>
<pre><style>
#div1 {
display: flexbox;
flex-flow: row wrap;
width: 300px;
}
button {
width: flex(80px 1);
}
<style>
<div id="div1">
<button id="button1">Elephant</button>
<button id="button2">Tiger</button>
<button id="button3">Antelope</button>
<button id="button4">Wildebeest</button>
</div></pre>
<p>The buttons are first set to their preferred widths, in this case 80 pixels. This will allow the first three buttons to fit in 240 pixels with 60 pixels left over of remaining space. Because the 'flex-flow' property specifies a multiline flexbox (due to the ''wrap'' keyword appearing in its value), the flexbox will create an additional line to contain the last button.</p>
<p>Flexibility is applied to each element, separately for each line. The first line has 60 pixels of remaining space and all of the buttons have the same flexibility, so each of the three buttons on that line will receive 20 pixels of extra width, ending up 100px wide. The remaining button is on a line of its own and will stretch to the entire width of the line, or 300 pixels.</p>
<div style="width:300px; border:medium solid green; overflow: hidden;">
<button style="width:100px; float: left;">Elephant</button>
<button style="width:100px; float: left;">Tiger</button>
<button style="width:100px; float: left;">Antelope</button>
<button style="width:300px; float: left;">Wildebeest</button>
</div>
<p>If the box was resized, the buttons may rearrange onto different lines as necessary.</p>
<p>If the style rules in the example above were changed to the following:</p>
<pre>
#div1 {
display: flexbox;
flex-flow: row wrap;
flex-pack: center;
width: 300px;
}
button {
width: flex(80px 1);
max-width: 90px;
}</pre>
<p>Similar to the previous example, the first three buttons will fit on the first line, and the last button will wrap onto a new line. However, when the buttons attempt to flex they can only grow to 90px each, due to their 'max-width' property. This leaves 30px of free space on the first line and 210px of free space on the second line. Because 'flex-pack' is set to ''center'', the buttons will be centered on each line, with the free space split equally on either side.</p>
<div style="width:300px; border:medium solid green; text-align:center;">
<button style="width:90px; float: left; margin-left: 15px;">Elephant</button>
<button style="width:90px; float: left;">Tiger</button>
<button style="width:90px; float: left;">Antelope</button>
<button style="width:90px">Wildebeest</button>
</div>
</div>
<h3 id='flex-line-pack'>
'flex-line-pack' property</h3>
<table class=propdef>
<tr>
<th>Name:
<td><dfn>flex-line-pack</dfn>
<tr>
<th>Value:
<td>start | end | center | distribute
<tr>
<th>Initial:
<td>before
<tr>
<th>Applies to:
<td>flexboxes
<tr>
<th>Inherited:
<td>no
<tr>
<th>Computed Value:
<td>specified value
<tr>
<th>Media:
<td>visual
</table>
<p>The flex-line-pack property may be used to control the alignment of lines in multi-line flexboxes. The values of this property have the following meanings:</p>
<dl>
<dt><dfn id='flex-line-pack-start'>start</dfn></dt>
<dd>The first line of child boxes is placed along the 'before' edge of the content box (as determined by direction of <i>cross axis</i>), and additional lines are placed afterward with no extra spacing between them.</dd>
<dt><dfn id='flex-line-pack-end'>end</dfn></dt>
<dd>Lines of child boxes are placed with no extra spacing between and 'after' edge of the last line is aligned with 'after' edge of the content box.</dd>
<dt><dfn id='flex-line-pack-center'>center</dfn></dt>
<dd>Lines of child boxes are placed with no space between them and equal amount of extra space left before first line and after last line.</dd>
<dt><dfn id='flex-line-pack-distribute'>distribute</dfn></dt>
<dd>The first line of child boxes is aligned with 'before' edge of containing box. Lines of child boxes are spread with equal amout of empty spaces between each two lines, and so that 'after' edge of last line of child boxes is aligned with 'after' edge of conaining box.</dd>
</dl>
<p class="issue">TODO: examples</p>
<h2 id='layout-algorithm'>
Flexbox Layout Algorithm</h2>
<p>This section contains normative algorithms detailing the exact layout behavior of a flexbox and its contents. The algorithms here were designed to optimize readability and theoretical simplicity, and may not necessarily be the most efficient. Implementations may use whatever actual algorithms they wish, but must produce the same results as the algorithms described here.</p>
<div class=issue>
<p>Here I'll outline the general structure of the layout algorithm, before I go into the ugly details below.</p>
<ol>
<li>Reorder flexbox items according to 'flex-order'.</li>
<li>Find the "hypothetical size" of every flexbox item by treating them like a normal element of their display type and the flexbox like a display:block element, and both the flexbox and the item establish BFCs. Resolve flexible widths/heights by treating them like their preferred size. Resolve 'auto' widths/heights by shrinkwrapping them.</li>
<li>Based on the hypothetical sizes of the items, find the real main size of the flexbox and the hypothetical cross size.</li>
<li>Based on both of these, linebreak the flexbox if it's multiline. (Or does the possibility of linebreaking affect the main size of the flexbox, in a shrinkwrapping way?)</li>
<li>Resolve any flexible lengths. All items now have a real main size.</li>
<li>Align in the main axis, per 'flex-pack'.</li>
<li>Based on 'flex-align', find the real cross size of the flexbox, its lines, and the items.</li>
<li>Align in the cross axis, per 'flex-align'.</li>
<li>Align the lines, per 'flex-line-pack'.</li>
</ol>
<p>Note that if any "hypothetical" size is a definite length or percentage, it's actually a real size immediately and won't change (well, aside from flexing). The hypothetical calculations are meant to give intermediate results in the presence of ''auto'' values (and others?), so I can do other calculations that depend on those lengths.</p>
</div>
<h2 id="pagination">
Page breaks in flexbox</h2>
<p class="issue">TODO: define how flexbox should break on pages, columns, etc. This may or may not be normative until there is more than one implementation.</p>
<p>Very roughly:</p>
<ul>
<li>Flexboxes can beak across pages between items, between rows of items (in multi-line mode) and inside items, as long as 'break-' property allow that. All 'break-' properties are supported on flexbox, on flexbox items and inside flexbox items.</li>
<li>Breaking behavior of a single-line vertical flexbox should be identical to a block in normal flow where children have same sizes and positions (e.g. explicitly set to match computed values in flexbox), same content and same breaking properties. <span class="issue">This is good goal or guidance, but not necessarily good normative definition. Get specific.</span> </li>
<li>Breaking behavior of a horizontal single-line flexbox should be similar (not necessarily identical) to that of a single-row table with same sizing.</li>
<li>In horizontal flexbox, a forced break within an items causes subsequent content of that item to go to next container, but it doesn't affect sibling items or their content.</li>
<li>In horizontal multi-line flexbox, values of 'break-before' and 'break-after' for each line are computed from combinatoin of properties on children that fit in that line (or would have fit, given available width and infinite height)</li>
</ul>
<p class="issue">TODO: define breaking of vertical multi-line flexbox</p>
<p class="issue">TODO: add more detail: how breaking affect sizing (for broken boxes and boxes after the break) and alignment</p>
<h2 id="layout-interface">
Box Properties and Sizing</h2>
<p class='issue'>Define how flexboxes are sized, paying attention to width/height keywords on both the flexbox and flexbox items, the writing modes of both the flexbox and flexbox items, and the flexbox direction.</p>
<hr title="Separator from footer">
<h2>Changes</h2>
<h3>Changes from ED 16-June-2011</h3>
<ul>
<li>Intro
<ul>
<li>Added definitions for main axis and cross axis</li>
<li>Added a pargraph on multiline</li>
</ul>
</li>
<li>'display' property
<ul>
<li>Removed issue for "display-inside" (now ACTION-342)</li>
</ul>
</li>
<li>Flex-item
<ul>
<li>New section, adds detail for flex item fixup</li>
<li>Removed issue for "other ignored properties"</li>
<li>Added issue on applicability of 'vertical-align'</li>
</ul>
</li>
<li>'flex-flow' property
<ul>
<li>Renamed (was 'flex-direction')</li>
<li>Values as in "option 8" <a href="http://wiki.csswg.org/spec/css3-flexbox#issue-2">http://wiki.csswg.org/spec/css3-flexbox#issue-2</a></li>
<li>Computed value: specified value (was lr/rl/tb/bt)</li>
<li>Prose describing how the pair of values work</li>
</ul>
</li>
<li>'flex-order'
<ul>
<li>Removed "flex-order vs. flex-index" issue. There is an issue at Wiki to finalize that, proposal to not change: <a href="http://wiki.csswg.org/spec/css3-flexbox#issue-8">http://wiki.csswg.org/spec/css3-flexbox#issue-8</a></li>
</ul>
</li>
<li>Flexibility
<ul>
<li>Removed 'fr' unit</li>
<li>Changed default/unspecified values to ''initial'', removed references to specifically 'width' and 'height'. No changes to what it applies to, but this way it is more general, in case it does need to apply to something else (for example to be part of grid rows/columns declarations)</li>
<li>Added a paragraph allowing (but not requiring) accepting unitless non-zero length in quirks mode, only when three values are specified.</li>
</ul>
</li>
<li>Flexible margins
<ul>
<li>Added issue 15: ''margin:auto'' as flex of 1 is not as powerful as ''margin:flex(2, 20, 5)''. Is it enough? A good use case would help (issue 16)</li>
</ul>
</li>
<li>'flex-align' property
<ul>
<li>Adapted most of the definition of 'flex-align' from 2009 spec</li>
<li>Note difference from 2009 spec remains – 'flex-align' applies to flexbox items, while 'box-align' of the old spec applied to flexbox.</li>
<li>Added definition for where is 'before' and where is 'after'</li>
<li>Open issue 14 for before/after to validate the definition.</li>
<li>Included definition of how flexbox cross-axis size is determined in case of baseline-aligned children or mixed.</li>
<li>Note: the core alignment algorithm copied from 2009 spec describes how auto margins work together with 'flex-align'. That algorithm is copied unchanged, proposed to adopt. It gives priority to margins over align (if I am reading it correctly): "flex-align:before; margin-top:auto" will end up being bottom-aligned in a horizontal flexbox.</li>
</ul>
</li>
<li>Multiline flexbox
<ul>
<li>Copied the section on multiline flexbox from 2009 spec, adapted to fit into the current draft</li>
</ul>
</li>
<li>'Flex-line-pack' property</li>
<li>Other
<ul>
<li>Replaced "measure axis" with "main axis"</li>
<li>Removed commented out intro draft</li>
</ul>
</li>
</ul>
<h2 class="no-num" id="acknowledgments">Acknowledgments</h2>
<p>[This section will contain further acknowledgments.]</p>
<p>Thanks for feedback from James Elmore and Shinichiro Hamaji.</p>
<h2 class="no-num" id="references">References</h2>
<h3 class="no-num" id="normative">Normative references</h3>
<!--normative-->
<h3 class="no-num" id="informative">Other references</h3>
<!--informative-->
<h2 id="property" class="no-num">Property index</h2>
<!--properties-->
<h2 class="no-num" id="index">Index</h2>
<!--index-->
</body></html>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-declaration:"~/SGML/HTML4.decl"
sgml-default-doctype-name:"html"
sgml-minimize-attributes:t
sgml-nofill-elements:("pre" "style" "br")
sgml-live-element-indicator:t
sgml-omittag:nil
sgml-shorttag:nil
sgml-namecase-general:t
sgml-general-insert-case:lower
sgml-always-quote-attributes:t
sgml-indent-step:nil
sgml-indent-data:t
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->