Working Draft · css-inline

CSS Inline Layout

14 properties, 1 type defined by this specification, 11 of them known to at least one browser (the others are badged Not in any browser yet).

Each feature in detail

alignment-baseline

Property Limited availability Modern CSS: alignment-baseline

MDN The alignment-baseline CSS property specifies the specific baseline used to align the box's text and inline-level contents. Baseline alignment is the relationship among the baselines of multiple alignment subjects within an alignment context. When performing baseline alignment, the alignment-baseline property value specifies which baseline of the box is aligned to the corresponding baseline of its alignment context.

Syntax

baseline | <baseline-metric>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
baseline
Applies to
inline-level boxes, flex items, grid items, table cells, and SVG text content elements
Inherited
no
Percentages
N/A
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting alignment-baseline
Chrome 1
Edge 79
Firefox 149
Safari 5.1
Chrome Android 18
Safari iOS 5

First version with support, from MDN browser-compat-data.

baseline-shift

Property Baseline: newly availablesince March 2026 Modern CSS: baseline-shift

MDN The baseline-shift CSS property repositions the dominant-baseline of a text element relative to the dominant-baseline of its parent text content element. The shifted element might be a sub- or superscript. If the property is present, the value overrides the element's baseline-shift attribute.

Live preview Example from MDN
text {
  font-family: cursive;
  font-size: 2rem;
}
[baseline-shift="sub"] {
  fill: deeppink;
}
[baseline-shift="super"] {
  fill: rebeccapurple;
}

svg:nth-of-type(2) tspan {
  baseline-shift: sub;
}
svg:nth-of-type(3) tspan {
  baseline-shift: super;
}

svg {
  border: 1px solid;
  width: 15em;
  margin-bottom: 10px;
}
@supports not (baseline-shift: sub) {
  body::before {
    content: "Your browser doesn't support the `baseline-shift` property.";
    background-color: wheat;
    display: block;
    text-align: center;
    padding: 1rem 0;
  }
}

Syntax

<length-percentage> | sub | super | top | center | bottom

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
0
Applies to
inline-level boxes and SVG text content elements
Inherited
no
Percentages
refer to the used value of line-height
Computed value
the specified keyword or a computed <length-percentage> value
Canonical order
per grammar
Animation type
by computed value type

Browser support

First browser version supporting baseline-shift
Chrome 1
Edge 79
Firefox 149
Safari 4
Chrome Android 18
Safari iOS 3.2

First version with support, from MDN browser-compat-data.

baseline-source

Property Limited availability Modern CSS: baseline-source

MDN The baseline-source CSS property defines which baseline to use when inline-level boxes have multiple possible baselines, such as multi-line inline blocks or inline flex containers. The values allow for choosing between aligning to the box's first baseline, last baseline, or letting the browser decide automatically based on the box type.

Live preview Example from MDN
body {
  font-family: sans-serif;
}

.box {
  border: 2px solid #888888;
  width: 50px;
}

span {
  padding: 0.4rem;
}

.box {
  display: inline-flex;
  flex-direction: column;
}

.first {
  baseline-source: first;
}

.auto {
  baseline-source: auto;
}

.last {
  baseline-source: last;
}

Syntax

auto | first | last

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
inline-level boxes that establish an independent formatting context
Inherited
no
Percentages
N/A
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting baseline-source
Chrome 111
Edge 111
Firefox 115
Safari No
Chrome Android 111
Safari iOS No

First version with support, from MDN browser-compat-data.

dominant-baseline

Property Baseline: widely availablesince July 2022

MDN 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.

Syntax

auto | <baseline-metric>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
block containers, inline boxes, table rows, grid containers, flex containers, and SVG text content elements
Inherited
yes
Percentages
N/A
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting dominant-baseline
Chrome 1
Edge 79
Firefox 1
Safari 4
Chrome Android 18
Safari iOS 3.2

First version with support, from MDN browser-compat-data.

initial-letter

Property Limited availability Modern CSS: initial-letter

MDN The initial-letter CSS property sets the size and sink for dropped, raised, and sunken initial letters. This property applies to ::first-letter pseudo-elements and inline-level first children of block containers.

Live preview Example from MDN
.normal::first-letter {
  -webkit-initial-letter: normal;
  initial-letter: normal;
}

.onefive::first-letter {
  -webkit-initial-letter: 1.5;
  initial-letter: 1.5;
}

.three::first-letter {
  -webkit-initial-letter: 3;
  initial-letter: 3;
}

p {
  outline: 1px dashed red;
}

Syntax

normal | <number [1,∞]> <integer [1,∞]> | <number [1,∞]> && [ drop | raise ]?

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
normal
Applies to
certain inline-level boxes and ::first-letter and inside ::marker boxes (see prose)
Inherited
no
Percentages
N/A
Computed value
the keyword normal or a number paired with an integer
Canonical order
per grammar
Animation type
by computed value type

Browser support

First browser version supporting initial-letter
Chrome 110
Edge 110
Firefox No
Safari 9 (-webkit- prefix)
Chrome Android 110
Safari iOS 9 (-webkit- prefix)

First version with support, from MDN browser-compat-data.

initial-letter-align

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

[ border-box? [ alphabetic | ideographic | hanging | leading ]? ]!

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
alphabetic
Applies to
certain inline-level boxes and ::first-letter and inside ::marker boxes (see prose)
Inherited
yes
Percentages
N/A
Computed value
specified keyword(s)
Canonical order
per grammar
Animation type
discrete

initial-letter-wrap

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

none | first | all | grid | <length-percentage>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
certain inline-level boxes and ::first-letter and inside ::marker boxes (see prose)
Inherited
yes
Percentages
relative to logical width of (last fragment of) initial letter
Computed value
specified keyword or computed <length-percentage> value
Canonical order
per grammar
Animation type
by computed value type

inline-sizing

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

normal | stretch

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
normal
Applies to
inline boxes, but not ruby container boxes nor internal ruby boxes
Inherited
yes
Percentages
n/a
Computed value
specified keyword
Canonical order
per grammar
Animation type
discrete

line-fit-edge

Property Not in any browser yet

No prose in the spec's definition and no MDN page yet: the spec link below is the only description.

Syntax

leading | <text-edge>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
leading
Applies to
inline boxes
Inherited
yes
Percentages
N/A
Computed value
the specified keyword
Canonical order
per grammar
Animation type
discrete

line-height

Property Baseline: widely availablesince January 2018

MDN The line-height CSS property sets the height of a line box in horizontal writing modes. In vertical writing modes, it sets the width of a line box. It's commonly used to set the distance between lines of text. On block-level elements in horizontal writing modes, it specifies the preferred height of line boxes within the element, and on non-replaced inline elements, it specifies the height that is used to calculate line box height.

Live preview Example from MDN
#example-element {
  font-family: "Georgia", serif;
  max-width: 200px;
}

Syntax

normal | <number [0,∞]> | <length-percentage [0,∞]>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
normal
Applies to
non-replaced inline boxes and SVG text content elements
Inherited
yes
Percentages
computed relative to 1em
Computed value
the specified keyword, a number, or a computed <length> value
Canonical order
per grammar
Animation type
by computed value type

Browser support

First browser version supporting line-height
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

text-box

Property Limited availability Modern CSS: text-box

MDN The text-box CSS shorthand property corresponds to the text-box-trim and text-box-edge properties, which together specify the amount of space to trim from the block-start edge and block-end edge of a text element's block container.

Live preview Example from MDN
html {
  font-family: sans-serif;
  height: 100%;
}

body {
  height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 100px;
}

p {
  margin: 0;
  font-size: 6rem;
  font-weight: bold;
}

.one {
  text-box: trim-end cap alphabetic;
}

.two {
  text-box: trim-both ex alphabetic;
}

p {
  border-top: 5px solid magenta;
  border-bottom: 5px solid magenta;
}

Syntax

normal | <'text-box-trim'> || <'text-box-edge'>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
normal
Applies to
block containers, multi-column containers, and inline boxes
Inherited
no
Percentages
N/A
Computed value
the specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting text-box
Chrome 133
Edge 133
Firefox 154
Safari 18.2
Chrome Android 133
Safari iOS 18.2

First version with support, from MDN browser-compat-data.

text-box-edge

Property Limited availability Modern CSS: text-box

MDN The text-box-edge CSS property specifies an amount of space to trim from a text element's block container.

Live preview Example from MDN
html {
  font-family: sans-serif;
  height: 100%;
}

body {
  height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 100px;
}

p {
  margin: 0;
  font-size: 6rem;
  font-weight: bold;
}

p {
  text-box-trim: trim-both;
  border-top: 5px solid magenta;
  border-bottom: 5px solid magenta;
}

.one {
  text-box-edge: cap alphabetic;
}

.two {
  text-box-edge: ex alphabetic;
}

Syntax

auto | <text-edge>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
auto
Applies to
block containers and inline boxes
Inherited
yes
Percentages
N/A
Computed value
the specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting text-box-edge
Chrome 133
Edge 133
Firefox 154
Safari 18.2
Chrome Android 133
Safari iOS 18.2

First version with support, from MDN browser-compat-data.

text-box-trim

Property Limited availability Modern CSS: text-box

MDN The text-box-trim CSS property specifies which of the over and under edges of text content to trim from a text element's block container.

Live preview Example from MDN
html {
  font-family: sans-serif;
  height: 100%;
}

body {
  height: inherit;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 100px;
}

p {
  margin: 0;
  font-size: 6rem;
  font-weight: bold;
}

p {
  text-box-edge: cap alphabetic;
  border-top: 5px solid magenta;
  border-bottom: 5px solid magenta;
}

.one {
  text-box-trim: trim-end;
}

.two {
  text-box-trim: trim-both;
}

Syntax

none | trim-start | trim-end | trim-both

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
none
Applies to
block containers, multi-column containers, and inline boxes
Inherited
no
Percentages
N/A
Computed value
the specified keyword
Canonical order
per grammar
Animation type
discrete

Browser support

First browser version supporting text-box-trim
Chrome 133
Edge 133
Firefox 154
Safari 18.2
Chrome Android 133
Safari iOS 18.2

First version with support, from MDN browser-compat-data.

vertical-align

Property Baseline: widely availablesince January 2018

MDN The vertical-align CSS shorthand property sets the vertical alignment of an inline, inline-block, or table-cell box.

Live preview Example from MDN
#default-example > p {
  line-height: 3em;
  font-family: monospace;
  font-size: 1.2em;
  text-decoration: underline overline;
}

Syntax

[ first | last] || <'alignment-baseline'> || <'baseline-shift'>

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Definition

Initial
baseline
Applies to
see individual properties
Inherited
no
Percentages
N/A
Computed value
see individual properties
Canonical order
per grammar
Animation type
see individual properties
Longhands
alignment-baseline, baseline-shift, baseline-source

Browser support

First browser version supporting vertical-align
Chrome 1
Edge 12
Firefox 1
Safari 1
Chrome Android 18
Safari iOS 1

First version with support, from MDN browser-compat-data.

<text-edge>

Type Limited availability Modern CSS: text-box

Spec The <text-edge> value, which identifies specific font metrics, expands to

MDN The <text-edge> enumerated data type defines keywords that specify font metrics representing specific regions on a font's block-start edge and block-end edge. Each keyword specifies a position of a font's over and/or under edge.

Syntax

[ text | ideographic | ideographic-ink ] | [ text | ideographic | ideographic-ink | cap | ex ] [ text | ideographic | ideographic-ink | alphabetic ]

Formal grammar from the specification, as webref extracts it: the latest level's definition, sometimes ahead of what browsers implement.

Browser support

First browser version supporting <text-edge>
Chrome 133
Edge 133
Firefox Preview
Safari 18.2
Chrome Android 133
Safari iOS 18.2

First version with support, from MDN browser-compat-data.