text-wrap: pretty
Chrome 117, Safari 26.0 (algoritmo mejorado); Firefox todavía no (caniuse hasta 158).
Chrome 117
Edge 117
Safari 26
Firefox no
Mejor ajuste de párrafos: evita palabras huérfanas, mejora la separación silábica y empareja el borde irregular de todo el párrafo (Safari evalúa el párrafo completo; Chrome las últimas líneas). La contraparte de `balance` para texto de cuerpo.
Pretty wrapping evaluates line breaks across the paragraph to avoid a single stranded word on the final line and to keep the right edge from looking ragged, which is what typographers do by hand.
CSS
.fx-041 {
text-wrap: pretty;
max-width: 42ch;
font-family: Georgia,serif;
line-height: 1.5;
hyphens: auto
}
HTML
<p class="fx-041">Pretty wrapping evaluates line breaks across the paragraph to avoid a single stranded word on the final line and to keep the right edge from looking ragged, which is what typographers do by hand.</p>Fallback: Firefox ajusta el texto de forma normal; inofensivo.
Prompt
Pon `text-wrap: pretty` en el texto de cuerpo, elementos de lista y descripciones (cualquier prosa de varias líneas), y `text-wrap: balance` en los títulos. No cuesta nada donde no está soportado, así que aplícalo globalmente a `p, li, dd, blockquote`.