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
Abstract: This module contains the features of <a href="http://www.w3.org/TR/CSS/">CSS</a> relating to the alignment of boxes within their containers in the various CSS box layout models: block layout, table layout, flex layout, and grid layout. (The alignment of text and inline-level content is defined in [[CSS3TEXT]] and [[CSS3LINE]].)
Link Defaults: selectors-3 (dfn) first formatted line/first formatted lines, css-flexbox-1 (dfn) flex line/flex lines, css-multicol-1 (dfn) multi-column element
16
+
Link Defaults: selectors-3 (dfn) first formatted line/first formatted lines, css-flexbox-1 (dfn) flex line/flex lines, css-multicol-1 (dfn) multi-column element, css-fonts-3 (dfn) first available font
Determining the Baseline of a Box</span><aclass=self-linkhref=#baseline-rules></a></h2>
964
964
965
965
<p> The <dfndata-dfn-type=dfndata-noexport="" id=first-baseline>first baseline<aclass=self-linkhref=#first-baseline></a></dfn> (and <dfndata-dfn-type=dfndata-noexport="" id=last-baseline>last baseline<aclass=self-linkhref=#last-baseline></a></dfn>) of a box
966
-
are determined differently based on the layout model, as follows:
966
+
for a given axis
967
+
is a set of baselines (alphabetic, central, etc.) belonging to a line box within the box.
968
+
The <adata-link-type=dfnhref=#alignment-baselinetitle="alignment baseline">alignment baseline</a> is one of these,
969
+
usually the dominant baseline of the <adata-link-type=dfnhref=#alignment-containertitle="alignment container">alignment container</a>.
970
+
(Note, however, that boxes might not have a baseline in a particular axis.)
971
+
972
+
<p> The first and last baselines of a box are determined differently based on the layout model, as follows:
If any cells in the row participate in <aclass=cssdata-link-type=maybehref=#valuedef-baselinetitle=baseline>baseline</a> (<spanclass=cssdata-link-type=maybetitle=last-baselin>last-baselin</span>) alignment,
998
-
the inline-axis first (last) baseline of the row is their baseline,
1003
+
If any cells in the row participate in <aclass=cssdata-link-type=maybehref=#valuedef-baselinetitle=baseline>baseline</a> (<aclass=cssdata-link-type=maybehref=#valuedef-last-baselinetitle=last-baseline>last-baseline</a>) alignment,
1004
+
the first (last) inline-axis baseline of the row is
1005
+
generated from their shared <adata-link-type=dfnhref=#alignment-baselinetitle="alignment baseline">alignment baseline</a> and the row’s <adata-link-type=dfnhref=http://dev.w3.org/csswg/css-fonts-3/#first-available-fonttitle="first available font">first available font</a>,
999
1006
after alignment has been performed.
1000
-
Otherwise, the inline-axis first (last) baseline of the row
1001
-
is the bottom content edge of the lowest cell in the row.
1007
+
Otherwise, the first (last) inline-axis baseline of the row
1008
+
is synthesized from the lowest and highest content edges of the cells in the row.
See <ahref=http://www.w3.org/TR/css3-grid-layout/#grid-baselines>Grid Baselines</a> in <adata-biblio-type=normativedata-link-type=bibliohref=#css3-grid-layouttitle=css3-grid-layout>[CSS3-GRID-LAYOUT]</a>.
<p> To <dfndata-dfn-type=dfndata-noexport="" id=generate-baselines>generate baselines<aclass=self-linkhref=#generate-baselines></a></dfn> for a box from a single baseline,
1031
+
use the baseline table from the font settings and <adata-link-type=dfnhref=http://dev.w3.org/csswg/css-fonts-3/#first-available-fonttitle="first available font">first available font</a> of that box.
1032
+
1033
+
<p> To <dfndata-dfn-type=dfndata-noexport="" id=synthesize-baselines>synthesize baselines<aclass=self-linkhref=#synthesize-baselines></a></dfn> from a rectangle (or two parallel lines),
1034
+
synthesize the alphabetic baseline from the lower line
1035
+
and the central baseline by averaging the positions of the upper and lower lines.
1036
+
1037
+
<pclass=note> Note: The forthcoming Inline Layout Module will define synthesis rules for baselines other than alphabetic and central.
0 commit comments