You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A <a>flex item</a> participates in first (last) <a>baseline content-alignment</a>
527
527
in its flex line if
528
528
its computed 'align-content' is ''baseline'' (''last-baseline'')
529
-
and its computed 'align-self' is ''<content-distribution>/stretch'' or ''start'' (''end'').
529
+
and its computed 'align-self' is ''align-self/stretch'' or ''start'' (''end'').
530
530
531
531
<dt>Grid Items:
532
532
<dd>
533
533
A <a>grid item</a> participates in first (last) <a>baseline content-alignment</a>
534
534
in either its row or column (whichever matches its <a>inline axis</a>)
535
535
if its computed 'align-content' is ''baseline'' (''last-baseline''),
536
-
and its computed 'align-self' or 'justify-self' (whichever affects its <a>block axis</a>) is ''<content-distribution>/stretch'' or ''start'' (''end'').
536
+
and its computed 'align-self' or 'justify-self' (whichever affects its <a>block axis</a>) is ''justify-self/stretch'' or ''start'' (''end'').
537
537
</dl>
538
538
539
539
If a box spans multiple <a>shared alignment contexts</a>,
@@ -596,11 +596,22 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
596
596
the box's outer edges are aligned within its <a>alignment container</a>
597
597
<a href="#alignment-values">as described by its alignment value</a>.
598
598
599
-
The <dfn value for="justify-self">auto</dfn> keyword computes to
599
+
The <dfn value for="justify-self, align-self">auto</dfn> keyword computes to
600
600
itself on absolutely-positioned elements,
601
601
and to the computed value of 'justify-items' on the parent
602
602
(minus any ''legacy'' keywords) on all other boxes,
603
603
or ''start'' if the box has no parent.
604
+
Its behavior depends on the layout model, as described below.
605
+
606
+
When the box’s computed 'width'/'height' (as appropriate to the axis) is ''width/auto''
607
+
and neither of its margins (in the appropriate axis) are ''margin/auto'',
608
+
the <dfn for="justify-self, align-self">stretch</dfn> keyword
609
+
sets the box’s used size to the length necessary to make its outer size
610
+
as close to filling the <a>alignment container</a> as possible
611
+
while still respecting the constraints imposed by 'min-height'/'min-width'/'max-height'/'max-width'.
612
+
Unless otherwise specified, this value falls back to ''flex-start''.
613
+
614
+
All other values are as defined in [[#alignment-values]], above.
604
615
605
616
<hr>
606
617
@@ -631,7 +642,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
631
642
632
643
When neither margin in this dimension is ''margin/auto''
633
644
and neither offset property in this dimension is ''top/auto'',
634
-
values other than ''<content-distribution>/stretch'' cause <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width">non-replaced absolutely-positioned boxes</a>
645
+
values other than ''justify-self/stretch'' cause <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-width">non-replaced absolutely-positioned boxes</a>
635
646
to use shrink-to-fit sizing for calculating ''width/auto'' measures,
636
647
and 'justify-self' dictates alignment as follows:
637
648
@@ -646,7 +657,7 @@ Inline/Main-Axis Alignment: the 'justify-self' property</h3>
646
657
and the used value of the offset properties are not adjusted to correct for the over-constraint.
647
658
648
659
The ''justify-self/auto'' keyword is equivalent to ''start'' on replaced absolutely-positioned boxes,
649
-
and equivalent to ''<content-distribution>/stretch'' on all other absolutely-positioned boxes.
660
+
and equivalent to ''justify-self/stretch'' on all other absolutely-positioned boxes.
650
661
(This is because CSS 2.1 does not stretch replaced elements to fit into fixed offsets.)
651
662
652
663
<dt>Table Cells:
@@ -697,11 +708,9 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
697
708
the box's outer edges are aligned within its <a>alignment container</a>
698
709
<a href="#alignment-values">as described by its alignment value</a>.
699
710
700
-
The <dfn value for="align-self">auto</dfn> keyword computes to
701
-
itself on absolutely-positioned elements,
702
-
and to the computed value of 'align-items' on the parent
703
-
(minus any ''legacy'' keywords) on all other boxes,
704
-
or ''start'' if the box has no parent.
711
+
The ''align-self/auto'' and ''align-self/stretch'' keywords are as defined in [[#justify-self-property]].
712
+
713
+
All other values are as defined in [[#alignment-values]], above.
705
714
706
715
<hr>
707
716
@@ -718,7 +727,7 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
718
727
719
728
When neither margin in this dimension is ''margin/auto''
720
729
and neither offset property in this dimension is ''top/auto'',
721
-
values other than ''<content-distribution>/stretch'' cause <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height">non-replaced absolutely-positioned boxes</a>
730
+
values other than ''align-self/stretch'' cause <a href="http://www.w3.org/TR/CSS21/visudet.html#abs-non-replaced-height">non-replaced absolutely-positioned boxes</a>
722
731
to use shrink-to-fit sizing for calculating ''width/auto'' measures,
723
732
and 'align-self' dictates alignment as follows:
724
733
@@ -733,7 +742,7 @@ Block/Cross-Axis Alignment: the 'align-self' property</h3>
733
742
and the used value of the offset properties are not adjusted to correct for the over-constraint.
734
743
735
744
The ''align-self/auto'' keyword is equivalent to ''start'' on replaced absolutely-positioned boxes,
736
-
and equivalent to ''<content-distribution>/stretch'' on all other absolutely-positioned boxes.
745
+
and equivalent to ''align-self/stretch'' on all other absolutely-positioned boxes.
737
746
(This is because CSS 2.1 does not stretch replaced elements to fit into fixed offsets.)
738
747
739
748
<dt>Table Cells:
@@ -835,7 +844,7 @@ Inline/Main-Axis Alignment: the 'justify-items' property</h3>
835
844
Otherwise, ''justify-items/auto'' computes to:
836
845
837
846
<ul>
838
-
<li>''<content-distribution>/stretch'' for flex containers and grid containers
847
+
<li>''justify-self/stretch'' for flex containers and grid containers
839
848
<li>''start'' for everything else
840
849
</ul>
841
850
@@ -876,7 +885,7 @@ Block/Cross-Axis Alignment: the 'align-items' property</h3>
876
885
Computes to:
877
886
878
887
<ul>
879
-
<li>''<content-distribution>/stretch'' for flex containers and grid containers
888
+
<li>''align-self/stretch'' for flex containers and grid containers
880
889
<li>''start'' for everything else
881
890
</ul>
882
891
</dl>
@@ -1034,13 +1043,9 @@ Aligning Boxes by Baseline</h3>
1034
1043
<h2 id="changes">
1035
1044
Changes</h2>
1036
1045
1037
-
Changes since the <a href="http://www.w3.org/TR/2013/WD-css3-align-20130514/">previous Working Draft</a> include:
1046
+
Changes since the <a href="http://www.w3.org/TR/2014/WD-css-align-3-20141218/">previous Working Draft</a> include:
1038
1047
1039
-
* Added ''last-baseline'' keyword.
1040
-
* Improved details of baseline alignment.
1041
-
* Changed handling of ''justify-self/auto''/''<content-distribution>/stretch'' for block-level and abspos elements in 'justify-self'/'align-self' to be more powerful and less confusing.
1042
-
* Tightened up grammar combinations with <<overflow-position>> to be restricted to values that actually make sense.
1043
-
* Various clarifications.
1048
+
* Fixed handling of ''justify-self: stretch'' (and 'align-self') to allow shrinking, as defined in Flexbox.
0 commit comments