Skip to content

Commit c67ed3a

Browse files
committed
[css-flexbox] Restore text explaining goal of static pos rules, clarify margin box vs content box
1 parent 4da7281 commit c67ed3a

2 files changed

Lines changed: 36 additions & 16 deletions

File tree

css-flexbox/Overview.bs

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -618,28 +618,38 @@ Absolutely-Positioned Flex Children</h3>
618618
beyond the <a href="#algo-flex-order">reordering step</a>.
619619

620620
The static position of an absolutely-positioned child of a <a>flex container</a>
621-
is determined by the 'justify-*'/'align-*' properties set on the <a>flex container</a> and the child:
621+
is determined such that the child is positioned
622+
as if it were the sole <a>flex item</a> in the <a>flex container</a>,
623+
assuming both the child and the flex container
624+
were fixed-size boxes of their used size.
625+
626+
In other words,
627+
if the static position were conceived of as a point to which the absolutely-positioned element is aligned,
628+
the static position of an absolutely-positioned child of a <a>flex container</a>
629+
is determined by the alignment properties set on the <a>flex container</a> and the child
630+
as if it were a zero-height, zero-width only-child in-flow flex item.
631+
Furthermore, the absolutely-positioned child aligns itself in the given axis
632+
to the static position in the same way:
622633

623634
<dl>
635+
624636
<dt>In the <a>main axis</a>
625637
<dd>
626638
If the <a>flex container's</a> 'justify-content' value
627-
would distribute a single <a>flex item</a>
639+
would align a single <a>flex item</a>
628640
to the start, center, or end side of the <a>main axis</a>,
629-
the static position in the <a>main axis</a> is the start, center, or end respectively.
641+
the static position in the <a>main axis</a> is the start, center, or end of the flex container's content box, respectively,
642+
and the absolutely-positioned box aligns its outer start, center, or end to the static position point, respectively.
630643

631644
<dt>In the <a>cross axis</a>
632645
<dd>
633646
If the child's 'align-self' value,
634647
if specified on a hypothetical single <a>flex item</a> child of the <a>flex container</a>,
635648
would align that hypothetical child to the start, center, or end side of the <a>cross axis</a>,
636-
the static position in the <a>cross axis</a> is the start, center, or end respectively.
649+
the static position in the <a>cross axis</a> is the start, center, or end of the flex container's content box, respectively,
650+
and the absolutely-positioned box aligns its outer start, center, or end to the static position point, respectively.
637651
</dl>
638652

639-
Further, the absolutely-positioned child aligns its start, center, or end in the given axis
640-
(whichever position the static position was set to)
641-
to the static position.
642-
643653
<div class='example'>
644654
The effect of this is that if you set, for example,
645655
''align-content: center;'' on an absolutely-positioned child of a <a>flex container</a>,

css-flexbox/Overview.html

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -771,28 +771,38 @@ <h3 class="heading settled heading" data-level=4.1 id=abspos-items><span class=s
771771
beyond the <a href=#algo-flex-order>reordering step</a>.</p>
772772

773773
<p>The static position of an absolutely-positioned child of a <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>
774-
is determined by the <a class=property data-link-type=propdesc title=justify-*>justify-*</a>/<a class=property data-link-type=propdesc title=align-*>align-*</a> properties set on the <a data-link-type=dfn href=#flex-container title="flex container">flex container</a> and the child:</p>
774+
is determined such that the child is positioned
775+
as if it were the sole <a data-link-type=dfn href=#flex-item title="flex item">flex item</a> in the <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>,
776+
assuming both the child and the flex container
777+
were fixed-size boxes of their used size.</p>
778+
779+
<p>In other words,
780+
if the static position were conceived of as a point to which the absolutely-positioned element is aligned,
781+
the static position of an absolutely-positioned child of a <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>
782+
is determined by the alignment properties set on the <a data-link-type=dfn href=#flex-container title="flex container">flex container</a> and the child
783+
as if it were a zero-height, zero-width only-child in-flow flex item.
784+
Furthermore, the absolutely-positioned child aligns itself in the given axis
785+
to the static position in the same way:</p>
775786

776787
<dl>
788+
777789
<dt>In the <a data-link-type=dfn href=#main-axis title="main axis">main axis</a>
778790
<dd>
779791
If the <a data-link-type=dfn href=#flex-container title="flex container’s">flex container’s</a> <a class=property data-link-type=propdesc href=#propdef-justify-content title=justify-content>justify-content</a> value
780-
would distribute a single <a data-link-type=dfn href=#flex-item title="flex item">flex item</a>
792+
would align a single <a data-link-type=dfn href=#flex-item title="flex item">flex item</a>
781793
to the start, center, or end side of the <a data-link-type=dfn href=#main-axis title="main axis">main axis</a>,
782-
the static position in the <a data-link-type=dfn href=#main-axis title="main axis">main axis</a> is the start, center, or end respectively.
794+
the static position in the <a data-link-type=dfn href=#main-axis title="main axis">main axis</a> is the start, center, or end of the flex container’s content box, respectively,
795+
and the absolutely-positioned box aligns its outer start, center, or end to the static position point, respectively.
783796

784797
<dt>In the <a data-link-type=dfn href=#cross-axis title="cross axis">cross axis</a>
785798
<dd>
786799
If the child’s <a class=property data-link-type=propdesc href=#propdef-align-self title=align-self>align-self</a> value,
787800
if specified on a hypothetical single <a data-link-type=dfn href=#flex-item title="flex item">flex item</a> child of the <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>,
788801
would align that hypothetical child to the start, center, or end side of the <a data-link-type=dfn href=#cross-axis title="cross axis">cross axis</a>,
789-
the static position in the <a data-link-type=dfn href=#cross-axis title="cross axis">cross axis</a> is the start, center, or end respectively.
802+
the static position in the <a data-link-type=dfn href=#cross-axis title="cross axis">cross axis</a> is the start, center, or end of the flex container’s content box, respectively,
803+
and the absolutely-positioned box aligns its outer start, center, or end to the static position point, respectively.
790804
</dl>
791805

792-
<p>Further, the absolutely-positioned child aligns its start, center, or end in the given axis
793-
(whichever position the static position was set to)
794-
to the static position.</p>
795-
796806
<div class=example>
797807
The effect of this is that if you set, for example,
798808
<a class=css data-link-type=propdesc href=#propdef-align-content title=align-content>align-content: center;</a> on an absolutely-positioned child of a <a data-link-type=dfn href=#flex-container title="flex container">flex container</a>,

0 commit comments

Comments
 (0)