The dominant-baseline
CSS property specifies the specific baseline used to align the box's text and inline-level contents. It also indicates the default alignment baseline of any boxes participating in baseline alignment in the box's alignment context. If present, it overrides the shape's dominant-baseline
attribute.
Baselines are selected from the font baseline table. If there is no baseline table in the nominal font, or if the baseline table lacks an entry for the desired baseline, then the browser may use heuristics to determine the position of the desired baseline.
The dominant-baseline
property is used to determine or re-determine a scaled-baseline-table. A scaled-baseline-table is a compound value with three components:
- a baseline-identifier for the dominant-baseline,
- a baseline-table, and
- a baseline-table font-size.
Some values of dominant-baseline
re-determine all three values. Others only re-establish the baseline-table font-size. When the initial value, auto
, would give an undesired result, this property can be used to explicitly set the desired scaled-baseline-table.
Note: The dominant-baseline
property only has an effect on the <text>
, <textPath>
, <tref>
, and <tspan>
SVG elements.