intent to prototype & ship: CSS text-indent keywords `hanging` & `each-line`

Skip to first unread message

Jonathan Kew

Oct 20, 2023, 8:56:56 AM10/20/23
As of Firefox 121, I intend to implement the `hanging` and `each-line`
keywords for the `text-indent` CSS property.

This is an extension of the existing `text-indent` property, and seems
pretty low risk, so I propose to immediately enable it by default,
although with a pref so that the new keywords could easily be disabled
in case of any unexpected issues.

The `text-indent` property is used to specify indentation of the first
line of a block (paragraph). The optional `hanging` and `each-line`
keywords let authors modify this behavior to produce "hanging
indentation" (where all lines *except* the first are indented), and/or
to apply the indent after forced breaks (<br>) as well as to the first
line of the block.

A `hanging` result can be obtained using margin or padding combined with
a negative `text-indent` length, but this is less obvious/convenient for
authors, and may conflict with other uses of padding or margins on the
block. To simulate `each-line`, authors would typically need to wrap
each line in additional markup.

Cases where such layout is commonly used include bibliographies and poetry.

For examples, see 29 & 30 in the linked spec.



Standards Body:
W3C CSS Working Group

Platform coverage:


DevTools bug:

Link to standards-positions discussion:
None, this has been in the spec for some time[1]

Other browsers:
Blink: not currently implemented
WebKit: shipping since Safari 15


[1] FTR, `each-line` originates 13 years ago in
The `hanging` keyword was present at least several years prior to that.
Reply all
Reply to author
0 new messages