Skip to content

Commit 5300cc2

Browse files
committed
[css-position-3] Rewrite intro
1 parent 9fad693 commit 5300cc2

1 file changed

Lines changed: 27 additions & 24 deletions

File tree

css-position-3/Overview.bs

Lines changed: 27 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -103,30 +103,33 @@ Introduction</h2>
103103

104104
<em>This section is not normative.</em>
105105

106-
In CSS, a box can be laid out according to three positioning schemes:
107-
108-
<dl>
109-
<dt>normal flow
110-
<dd>
111-
In CSS, [=normal flow=] includes
112-
<a href="https://www.w3.org/TR/CSS2/visuren.html#block-formatting">block formatting</a> of block-level boxes,
113-
<a href="https://www.w3.org/TR/CSS2/visuren.html#inline-formatting">inline formatting</a> of inline-level boxes,
114-
and <a lt="relative positioning" spec="css2">relative</a> and <a lt="sticky positioning">sticky</a> positioning of block-level and inline-level boxes.
115-
116-
<dt>floats
117-
<dd>
118-
In the <a>float</a> model,
119-
a box is first laid out according to the <a>normal flow</a>,
120-
then taken out of the flow and positioned, typically to the left or right.
121-
Content may flow along the side of a [=float=].
122-
123-
<dt>absolute positioning
124-
<dd>
125-
In the absolute positioning model,
126-
a box is removed from the [=normal flow=] entirely
127-
(it has no impact on later siblings)
128-
and assigned a position with respect to a [=containing block=].
129-
</dl>
106+
The CSS layout algorithms, by default,
107+
size and position boxes in relation to each other
108+
so that nothing overlaps.
109+
110+
This specification defines several ways to violate these assumptions when needed,
111+
moving elements around in ways that can make them overlap other content:
112+
113+
* [=Relative positioning=], which visually shifts a box relative to its laid-out location.
114+
* [=Sticky positioning=], which visually shifts a box relative to its laid-out location
115+
in order to keep it visible when a scrollable ancestor
116+
would otherwise scroll it out of sight.
117+
* [=Absolute positioning=], which ignores normal layout entirely,
118+
pulling the element out of flow and
119+
and positioning it relative to its [=containing block=]
120+
with no regard for other content.
121+
* [=Fixed positioning=], which absolutely positions the box
122+
and affixes it to the viewport or page frame
123+
so that it is always visible.
124+
125+
These [=positioning schemes=],
126+
controlled by the 'position' property and the [=inset properties=],
127+
are powerful
128+
but easy to misuse.
129+
With appropriate care,
130+
they allow many interesting and useful layouts
131+
that couldn't otherwise be achieved with standard layout rules;
132+
without, they allow a page to be laid out in an unusable overlapping jumble of content.
130133

131134
<h3 id="placement">
132135
Module Interactions</h3>

0 commit comments

Comments
 (0)