@@ -220,7 +220,7 @@ Choosing A Positioning Scheme: 'position' property</h2>
220220 and does not affect the size or position of any other box,
221221 except insofar as it increases the [=scrollable overflow area=] of its ancestors.
222222 This [=positioning scheme=] is called
223- <dfn export dfn lt="relative position|relatively position|relatively-positioned" local-lt="relative|relatively">relative positioning</dfn> .
223+ <dfn export dfn lt="relative position|relatively position|relatively-positioned|sticky-positioned box " local-lt="relative|relatively">relative positioning</dfn> .
224224
225225 <dt> <dfn>sticky</dfn>
226226 <dd>
@@ -246,7 +246,7 @@ Choosing A Positioning Scheme: 'position' property</h2>
246246 It can overlap in-flow siblings
247247 or other [=absolutely positioned=] elements.
248248 This [=positioning scheme=] is called
249- <dfn export dfn lt="absolute position|absolutely position|absolutely-positioned" local-lt="absolute|absolutely">absolute positioning</dfn> .
249+ <dfn export dfn lt="absolute position|absolutely position|absolutely-positioned|absolutely positioned box " local-lt="absolute|absolutely">absolute positioning</dfn> .
250250
251251 <dt> <dfn>fixed</dfn>
252252 <dd>
@@ -257,7 +257,7 @@ Choosing A Positioning Scheme: 'position' property</h2>
257257 it does not move when the document is scrolled,
258258 and is replicated on every page when it is paginated.
259259 This [=positioning scheme=] is called
260- <dfn export dfn lt="fixed position|fixed-positioned" local-lt="fixed">fixed positioning</dfn>
260+ <dfn export dfn lt="fixed position|fixed-positioned|fixed-positioned box " local-lt="fixed">fixed positioning</dfn>
261261 and is considered a subset of [=absolute positioning=] .
262262
263263 <div class="example">
@@ -292,6 +292,7 @@ Containing Blocks of Positioned Boxes</h3>
292292 The [=containing block=] is established by
293293 the [=viewport=] in the case of [=continuous media=] ,
294294 or the [=page area=] in the case of [=paged media=] .
295+ See [[#fixed-pos]] .
295296
296297 <dt id="absolute-cb"> If the box has ''position: absolute'' :
297298 <dd>
@@ -613,26 +614,23 @@ Sticky positioning</h3>
613614 are offset independently,
614615 and therefore might overlap.
615616
616- <!-- End section: Sticky positioning -->
617+ <!-- End section: Sticky positioning -->
617618
618619<h3 id="abs-pos">
619620Absolute positioning</h3>
620621
621- In the absolute positioning model,
622- a box is explicitly offset with respect to its <a>containing block</a> .
623- It is removed from the <a>normal flow</a> entirely
624- (it has no impact on later siblings).
625- An absolutely positioned box establishes a new <a>containing block</a>
626- for normal flow children and absolutely (but not fixed) positioned descendants.
627- However, the contents of an absolutely positioned element do not flow around any other boxes.
628- They may obscure the contents of another box (or be obscured themselves),
629- depending on the stack levels of the overlapping boxes.
622+ For an [=absolutely positioned=] box,
623+ the [=inset properties=] effectively reduce the [=containing block=]
624+ into which it is sized and positioned.
630625
631- References in this specification to an absolutely positioned element (or its box)
632- imply that the element’s 'position' property has the value ''absolute'' or ''fixed'' .
626+ If this results in an effective [=containing block=] size in any axis
627+ less than zero,
628+ then the effective end-edge inset in the affected axis
629+ is reduced to bring that size up to zero.
633630
634- Though absolutely positioned boxes may have margins,
635- those margins do not <a href="https://www.w3.org/TR/CSS2/box.html#collapsing-margins">collapse</a> with any other margins.
631+ Sizing and positioning of the [=absolutely positioned box=]
632+ into this effective [=containing block=]
633+ is as described in [[#size-and-position-details]] .
636634
637635<h4 id="breaking">
638636Fragmenting Absolutely-positioned Elements</h4>
@@ -666,104 +664,28 @@ Fragmenting Absolutely-positioned Elements</h4>
666664<h3 id="fixed-pos">
667665Fixed positioning</h3>
668666
669- Fixed positioning is similar to absolute positioning.
670- The only difference is that for a fixed positioned box,
671- the <a>containing block</a> is established by the <a>viewport</a> .
672- For <a href="https://www.w3.org/TR/CSS2/media.html#continuous-media-group">continuous media</a> ,
673- fixed boxes do not move when the document is scrolled.
674- In this respect, they are similar to
675- <a href="https://www.w3.org/TR/CSS2/colors.html#background-properties">fixed background images</a> .
676- For <a href="https://www.w3.org/TR/CSS2/media.html#paged-media-group">paged media</a> ,
677- boxes with fixed positions are repeated on every page.
678- This is useful for placing, for instance, a signature at the bottom of each page.
679- Boxes with fixed position that are larger than the page area are clipped.
680- Parts of the fixed position box that are not visible in the <a>initial containing block</a>
681- will not print.
682-
683- The box’s position is calculated according to the "absolute" model,
684- but in addition,
685- the box is fixed with respect to some reference.
686- As with the "absolute" model,
687- the box’s margins do not collapse with any other margins.
688- In the case of handheld, projection, screen, tty, and tv media types,
689- the box is fixed with respect to the <a>viewport</a> and does not move when scrolled.
690-
691- In the case of the print media type,
692- the box is rendered on every page,
693- and is fixed with respect to the page box,
694- even if the page is seen through a <a>viewport</a>
695- (in the case of a print-preview, for example).
696-
697- For other media types, the presentation is undefined.
667+ [=Fixed positioning=] is similar to absolute positioning.
668+ The only difference is that for a [=fixed positioned box=] ,
669+ the <a>containing block</a> is:
698670
699- <div class="example">
700- Authors can use fixed positioning to create the following presentation:
671+ * in <a href="https://www.w3.org/TR/CSS2/media.html#continuous-media-group">continuous media</a> ,
672+ the <a>viewport</a> ;
673+ as a result, [=fixed=] boxes do not move when the document is scrolled.
701674
702- <figure>
703- <img src="images/frame.png" alt="Example of frame layout">
704- <figcaption>
705- A page layout with a static header and footer at the top and bottom,
706- a sidebar to one side,
707- and main content filling the remaining center space.
708- </figcaption>
709- </figure>
675+ Note: In this respect, they are similar to
676+ <a href="https://www.w3.org/TR/CSS2/colors.html#background-properties">fixed background images</a> .
710677
711- This might be achieved with the following HTML document and style rules:
678+ * in <a href="https://www.w3.org/TR/CSS2/media.html#paged-media-group">paged media</a> ,
679+ the [=page area=] of each page;
680+ [=fixed boxes=] are thus replicated on every page.
681+ (They are fixed with respect to the page box only,
682+ and are not affected by being seen through a [=viewport=] ;
683+ as in the case of print preview, for example.)
712684
713- <pre class="lang-html">
714- <!DOCTYPE html>
715- <html>
716- <head>
717- <title>A frame document with CSS</title>
718- <style type="text/css" media="screen">
719- body { height: 8.5in } /* Required for percentage heights below */
720- #header {
721- position: fixed;
722- width: 100%;
723- height: 15%;
724- top: 0;
725- right: 0;
726- bottom: auto;
727- left: 0;
728- }
729- #sidebar {
730- position: fixed;
731- width: 10em;
732- height: auto;
733- top: 15%;
734- right: auto;
735- bottom: 100px;
736- left: 0;
737- }
738- #main {
739- position: fixed;
740- width: auto;
741- height: auto;
742- top: 15%;
743- right: 0;
744- bottom: 100px;
745- left: 10em;
746- }
747- #footer {
748- position: fixed;
749- width: 100%;
750- height: 100px;
751- top: auto;
752- right: 0;
753- bottom: 0;
754- left: 0;
755- }
756- </style>
757- </head>
758- <body>
759- <div id="header"> ... </div>
760- <div id="sidebar"> ... </div>
761- <div id="main"> ... </div>
762- <div id="footer"> ... </div>
763- </body>
764- </html>
765- </pre>
766- </div>
685+ As a result, parts of [=fixed-positioned boxes=]
686+ that extend outside the <a>initial containing block</a>
687+ cannot be scrolled to
688+ and will not print.
767689
768690<!-- End section: Fixed positioning -->
769691<!-- End section: Positioning schemes -->
0 commit comments