W3docs

Propiedad CSS text-stroke-width

Use the text-stroke-width CSS property to define the width of the stroke. See the Value, Practice with examples.

La propiedad -webkit-text-stroke-width especifica el ancho del trazo del texto.

info

La propiedad text-stroke-width no está estandarizada como propiedad independiente. La abreviatura estándar es text-stroke (CSS Text Level 4). Para un amplio soporte en navegadores, utiliza el prefijo de proveedor -webkit-.

Valor inicial0
Se aplica aTodos los elementos.
HeredadoNo.
AnimableNo
VersiónCSS Text Level 4 (con prefijo de proveedor)
Sintaxis DOMobject.style.webkitTextStrokeWidth = "1px";

Sintaxis

Valores de CSS text-stroke-width

-webkit-text-stroke-width: length | initial | inherit;

Ejemplo de la propiedad text-stroke-width:

Ejemplo de código CSS text-stroke-width

<!DOCTYPE html>
<html>
  <head>
    <title>Title of the document</title>
    <style>
      p, h2 {
        margin: 0;
        font-size: 4em;
        -webkit-text-stroke-color: #1c87c9;
      }
      .thin {
        -webkit-text-stroke-width: 1px;
      }
      .medium {
        -webkit-text-stroke-width: 3.5px;
      }
      .thick {
        -webkit-text-stroke-width: 1.3mm;
      }
    </style>
  </head>
  <body>
    <h2>Text-stroke-width property example</h2>
    <p class="thin">Lorem Ipsum </p>
    <p class="medium">Lorem Ipsum</p>
    <p class="thick">Lorem Ipsum</p>
  </body>
</html>

Resultado

CSS text-stroke-width values list

Nota: Donde sea compatible, utiliza la abreviatura estándar text-stroke en lugar de la propiedad con prefijo.

Valores

ValorDescripción
lengthEspecifica el grosor del trazo.
initialHace que la propiedad utilice su valor predeterminado.
inheritHereda la propiedad de su elemento padre.

Práctica

Práctica

¿Cuál de las siguientes afirmaciones es incorrecta sobre la propiedad CSS text-stroke-width?