Saltar al contenido

Propiedad CSS text-decoration-color

La propiedad text-decoration-color se utiliza para establecer el color de la decoración del texto. Puedes elegir colores desde aquí Colores HTML.

Estos colores se aplican a decoraciones como líneas superiores, subrayados y líneas onduladas.

La propiedad text-decoration-color es una de las propiedades CSS3.

Valor inicialcurrentColor
Se aplica aTodos los elementos. También se aplica a ::first-letter y ::first-line.
HeredableNo.
AnimableSí. El color es animable.
VersiónCSS Text Decoration Module Level 3
Sintaxis DOMobject.style.textDecorationColor = "#ccc";

Sintaxis

Sintaxis de CSS text-decoration-color

css
text-decoration-color: color | initial | inherit;

INFO

Nota: El uso de la propiedad abreviada text-decoration restablece text-decoration-color a currentColor.

Ejemplo de la propiedad text-decoration-color:

Ejemplo de código CSS text-decoration-color

html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the text</title>
    <style>
      p {
        text-decoration: overline underline;
        text-decoration-color: #8ebf42;
      }
    </style>
  </head>
  <body>
    <h2>Text-decoration-color property example</h2>
    <p>Lorem ipsum is simply dummy text...</p>
  </body>
</html>

Resultado

CSS text-decoration-color

Ejemplo de la propiedad text-decoration-color con los valores "underline" y "line-through":

Ejemplo de todos los valores de CSS text-decoration-color

html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      p {
        text-decoration-line: underline;
        text-decoration-color: #666666;
        text-decoration-style: wavy;
      }
      s {
        text-decoration-line: line-through;
        text-decoration-color: #c91010;
      }
    </style>
  </head>
  <body>
    <h2>Text-decoration-color property example</h2>
    <p>Lorem ipsum is <s>simply dummy</s> text...</p>
  </body>
</html>

Valores

ValorDescripciónProbar
colorDefine el color de la decoración del texto. Se pueden usar nombres de colores, códigos hexadecimales, rgb(), rgba(), hsl(), hsla() y currentColor.Probar »
initialEstablece la propiedad en su valor predeterminado.Probar »
inheritHereda la propiedad de su elemento padre.

Práctica

¿Qué se puede establecer usando la propiedad 'text-decoration-color' en CSS?

¿Te resulta útil?

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