<baseline-position> CSS type

The <baseline-position> enumerated value type represents a baseline alignment with the first or last modifier.

Associated properties

This data type is accepted in the values of the following CSS properties:

Syntax

<baseline-position> = [ first | last ]? && baseline

Values

The <baseline-position> data type is defined using a keyterm value chosen from the following list:

baseline

Computes to first baseline.

first baseline

Aligns the alignment baseline of the box's first baseline set with the corresponding baseline of its baseline-sharing group.

last baseline

Aligns the alignment baseline of the box's last baseline set with the corresponding baseline of its baseline-sharing group.

Description

The <baseline-position> enumerated value type is specified using an optional first or last modifier with the baseline value. The first and last values give a box a baseline alignment preference, defaulting to first if the modifier is omitted.

Baseline alignment is a positional alignment that aligns alignable features within a shared alignment context (such as cells within a row) by matching up their alignment baselines. For justify-self and align-self, the aligned feature is the item's margin box. With justify-content and align-content, the content feature that determines the alignment depends on the layout mode.

If the alignment position of the elements within a baseline-sharing group is not fully constrained by baseline alignment (i.e., they could be shifted within their respective alignment containers while maintaining baseline alignment), they are fallback-aligned. The fallback alignment is also used to align the baseline-sharing group within its alignment container:

  • The fallback alignment for baseline and first baseline is safe self-start for self-alignment or safe start for content distribution.
  • The fallback alignment for last baseline is safe self-end for self-alignment or safe end for content distribution.

Specifications

Specification
CSS Box Alignment Module Level 3
# typedef-baseline-position

See also