Qu'est-ce que Constructeur CSS text-indent hanging/each-line ?
CSS text-indent now supports the hanging and each-line keywords (Baseline 2026: Chrome 130+, Safari 18.2+, Firefox 135+). hanging reverses the direction of the indent: the first line stays flush left and all subsequent lines are indented by the specified length. each-line applies indentation after every forced line break (such as <br>), not just the first line. You can combine both keywords with a length value: text-indent: 2em hanging each-line creates a hanging indent that also resets after every line break.
Réponse rapide
Use text-indent: 2em hanging to create a hanging indent where the first line is flush left and subsequent lines are indented by 2em. Add each-line to also apply indentation after every forced line break. Browser support: Chrome 130+, Safari 18.2+, Firefox 135+ (Baseline 2026). The tool generates a fallback for older browsers that ignores the keywords and applies a normal first-line indent.
Limites
- hanging and each-line require Baseline 2026 browsers (Chrome 130+, Safari 18.2+, Firefox 135+). Older browsers silently ignore the keywords and apply a standard first-line indent instead -- acceptable for progressive enhancement but may break precise layout requirements.
- each-line only triggers on forced line breaks (<br>, <hr>, or elements with display: block inside the text). It does not reset after soft-wrapped lines in narrow containers. If you need indentation control per soft-wrapped line, consider padding-left with a negative text-indent workaround.
- text-indent does not work on inline elements. For inline-level hanging indents in mixed inline/block layouts, use padding-left with the desired indent width and a negative text-indent on the parent block container.
Comment utiliser cet outil
- Choose the indent length value in em, px, or rem units. 2em is the standard for bibliography hanging indents.
- Toggle the hanging keyword to create a reverse indent where the first line is flush left and subsequent lines indented.
- Toggle the each-line keyword to apply the indent after every forced line break (<br>) in addition to the first line.
- Copy the generated CSS declaration including the fallback for browsers without hanging or each-line support.
A quoi il sert
- Format bibliography entries with a hanging indent where the first line is flush left and subsequent lines are indented, matching academic citation style guides.
- Create definition lists where the term is flush left and the definition text is indented, using hanging with each-line to handle multi-line definitions with line breaks.
- Apply hanging punctuation effects where opening quotes and bullets hang outside the text margin for a polished typographic look.