Saltar al contenido

Propiedad CSS hanging-punctuation

La propiedad hanging-punctuation especifica si un signo de puntuación debe colgar al inicio o al final de la línea de un texto.

La puntuación colgante se utiliza con texto completamente justificado y controla la alineación de todas las líneas de un párrafo cuando se usa al final de las líneas.

Valor inicialnone
Se aplica aTodos los elementos.
HeredableSí.
AnimableNo.
VersiónCSS3
Sintaxis DOMobject.style.hangingPunctuation = "last";

Sintaxis

Sintaxis de la propiedad CSS hanging-punctuation

css
hanging-punctuation: none | first | last | allow-end | force-end | initial | inherit;

Ejemplo de la propiedad hanging-punctuation:

Ejemplo de la propiedad CSS hanging-punctuation con el valor first

html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      blockquote {
        font-style: normal;
        font-size: 25px;
        width: 20em;
        border-left: 1px solid #000;
        padding: 3rem 0;
        hanging-punctuation: first;
      }
    </style>
  </head>
  <body>
    <h2>Hanging-punctuation property example</h2>
    <blockquote>"Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s".</blockquote>
  </body>
</html>

Resultado

CSS hanging-punctuation Property

Valores

ValorDescripción
noneLa puntuación colgante no se aplica. Este es el valor predeterminado de esta propiedad.
firstUn signo de puntuación colgará fuera del borde inicial de la primera línea.
lastUn signo de puntuación colgará fuera del borde final de la última línea.
allow-endUn signo de puntuación colgará fuera del borde final de una línea si no cabe de otra manera antes de la justificación.
force-endUn signo de puntuación colgará fuera del borde final de todas las líneas. Si la justificación está habilitada en esta línea, forzará que la puntuación cuelgue.

Práctica

¿Qué hace la propiedad de puntuación colgante en CSS?

¿Te resulta útil?

Vista previa dual-run — compárala con las rutas Symfony en producción.