Saltar al contenido

Propiedad CSS text-decoration-style

La propiedad text-decoration-style especifica el estilo de la decoración de texto. Los estilos pueden ser sólido, discontinuo, punteado, doble y ondulado.

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

Valor inicialsolid
Se aplica aTodos los elementos. También se aplica a ::first-letter y ::first-line.
HeredableNo.
AnimableNo.
VersiónCSS3
Sintaxis DOMobject.style.textDecorationStyle = "dotted";

Sintaxis

Valores de CSS text-decoration-style

css
text-decoration-style: solid | double | dotted | dashed | wavy | initial | inherit;

Ejemplo de la propiedad text-decoration-style:

Ejemplo de text-decoration-style

html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      div {
        text-decoration-line: underline;
        text-decoration-style: solid;
        text-decoration-color: #1c87c9;
      }
    </style>
  </head>
  <body>
    <h2>Text-decoration-style property example</h2>
    <div>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</div>
  </body>
</html>

Resultado

CSS text-decoration-style wavy

Ejemplo de la propiedad text-decoration-style con el valor "wavy":

Ejemplo de código de text-decoration-style wavy

html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      div {
        text-decoration-line: underline;
        text-decoration-style: wavy;
        text-decoration-color: #1c87c9;
      }
    </style>
  </head>
  <body>
    <h2>Text-decoration-style property example</h2>
    <div>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</div>
  </body>
</html>

Ejemplo de la propiedad text-decoration-style con el valor "dotted":

Ejemplo de código de text-decoration-style dotted

html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      div {
        text-decoration-line: overline;
        text-decoration-style: dotted;
        text-decoration-color: #1c87c9;
      }
    </style>
  </head>
  <body>
    <h2>Text-decoration-style property example</h2>
    <div>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</div>
  </body>
</html>

Ejemplo de la propiedad text-decoration-style con el valor "dashed":

Ejemplo de código de text-decoration-style dashed

html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      div {
        text-decoration-line: overline;
        text-decoration-style: dashed;
        text-decoration-color: #1c87c9;
      }
    </style>
  </head>
  <body>
    <h2>Text-decoration-style property example</h2>
    <div>
      Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
  </body>
</html>

Ejemplo de la propiedad text-decoration-style con el valor "double":

Ejemplo de código de text-decoration-style double

html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      div {
        text-decoration-line: overline underline;
        text-decoration-style: double;
        text-decoration-color: #1c87c9;
      }
    </style>
  </head>
  <body>
    <h2>Text-decoration-style property example</h2>
    <div>
      Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
  </body>
</html>

Ejemplo de la propiedad text-decoration-style con todos los valores:

Ejemplo de todos los valores de text-decoration-style

html
<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      div {
        margin: 20px 0;
      }
      div.t1 {
        text-decoration-line: overline underline;
        text-decoration-style: solid;
      }
      div.t2 {
        text-decoration-line: line-through;
        text-decoration-style: wavy;
      }
      div.t3 {
        text-decoration-line: overline underline;
        text-decoration-style: double;
      }
      div.t4 {
        text-decoration-line: overline;
        text-decoration-style: dashed;
      }
      div.t5 {
        text-decoration-line: line-through;
        text-decoration-style: dotted;
      }
    </style>
  </head>
  <body>
    <h2>Text-decoration-style property example</h2>
    <div class="t1">
      Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
    <div class="t2">
      Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
    <div class="t3">
      Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
    <div class="t4">
      Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
    <div class="t5">
      Lorem Ipsum is simply dummy text of the printing and typesetting industry.
    </div>
  </body>
</html>

Valores

ValorDescripciónProbarlo
solidDefine una línea única. Este es el valor predeterminado de esta propiedad.Probarlo »
doubleDefine una línea doble.Probarlo »
dottedDefine una línea punteada.Probarlo »
dashedDefine una línea discontinua.Probarlo »
wavyDefine una línea ondulada.Probarlo »
initialEstablece la propiedad en su valor predeterminado.Probarlo »
inheritHereda la propiedad de su elemento padre.

Práctica

¿Cuál de los siguientes es un valor de propiedad válido para 'text-decoration-style' en CSS?

¿Te resulta útil?

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