Vixen
dd8b0a81
csharp
public enum VerticalAlign

How an inline-level box sits against the line box it is on, per CSS 2.1 §10.8.1.

Read the guide page for this →

Remarks

⚠ The split that used to be "three work and five are refused" is now a split between the values that need a strut and the values that do not, and the five are honoured wherever one has been written down. Baseline, Top and Bottom are geometry this store computes for itself: a baseline, and the two edges of a box it just laid out. Middle, TextTop, TextBottom, Sub and Super are each defined against the parent's strut — its font's ascent, descent or x-height — and this is still a geometry store with no font in it. What changed is that a strut is five numbers rather than a font: StrutMetrics is a computed value the layer that owns the fonts writes on the container, the same way it already writes a resolved font size.

⚠ Where no strut was written the five still fall back to Baseline, and that refusal is unchanged. A silent fallback would put vertical-align: middle half an x-height out and read as a rounding error rather than as a missing number; what the fallback now means is "nobody supplied a font", not "this store cannot".

Offset is the <length> and <percentage> form and needs no strut at all — it is a signed distance in VerticalAlignOffset, and the percentage is resolved against the element's own line-height before it gets here, where a line height still exists.

Fields and properties (9)

  • Baseline

    The box's baseline sits on the line's. The initial value.

  • Top

    The box's top edge sits against the top of the line box.

  • Bottom

    The box's bottom edge sits against the bottom of the line box.

  • Middle

    Centred on the parent's baseline plus half its x-height. Needs a strut.

  • TextTop

    Aligned with the top of the parent's content area. Needs a strut.

  • TextBottom

    Aligned with the bottom of the parent's content area. Needs a strut.

  • Sub

    Lowered to the parent's subscript position. Needs a strut.

  • Super

    Raised to the parent's superscript position. Needs a strut.

  • Offset

    Raised by VerticalAlignOffset, which is negative to lower it.

Used by (7)

  • InlineFormattingTestsVixen.Ui.Layout.Tests
  • InlineStrutTestsVixen.Ui.Layout.Tests
  • KeywordsVixen.Ui
  • LayoutStyleVixen.Ui.Layout
  • LayoutStyleBridgeTestsVixen.Ui.Tests
  • LayoutStyleBuilderVixen.Ui
  • LayoutTreeVixen.Ui.Layout