Propiedad CSS -webkit-text-stroke-width
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since abril de 2017.
La propiedad -webkit-text-stroke-width CSS especifica el ancho del trazo del texto.
Sintaxis
css
/* Valores de palabra clave */
-webkit-text-stroke-width: thin;
-webkit-text-stroke-width: medium;
-webkit-text-stroke-width: thick;
/* Valores de <length> */
-webkit-text-stroke-width: 2px;
-webkit-text-stroke-width: 0.1em;
-webkit-text-stroke-width: 1mm;
-webkit-text-stroke-width: 5pt;
/* Valores globales */
-webkit-text-stroke-width: inherit;
-webkit-text-stroke-width: initial;
-webkit-text-stroke-width: revert;
-webkit-text-stroke-width: revert-layer;
-webkit-text-stroke-width: unset;
Valores
Esta propiedad se especifica con el siguiente valor:
<line-width>-
El ancho del trazo.
Definición formal
| Valor inicial | 0 |
|---|---|
| Applies to | all elements |
| Heredable | yes |
| Valor calculado | absolute <length> |
| Animation type | discrete |
Sintaxis formal
-webkit-text-stroke-width =
<line-width>
<line-width> =
<length [0,∞]> |
hairline |
thin |
medium |
thick
Ejemplos
>Anchos de trazo variables
CSS
css
p {
margin: 0;
font-size: 4em;
-webkit-text-stroke-color: red;
}
#thin {
-webkit-text-stroke-width: thin;
}
#medium {
-webkit-text-stroke-width: 3px;
}
#thick {
-webkit-text-stroke-width: 1.5mm;
}
HTML
html
<p id="thin">Trazo fino</p>
<p id="medium">Trazo medio</p>
<p id="thick">Trazo grueso</p>
Resultado
Especificaciones
| Specification |
|---|
| Compatibility> # the-webkit-text-stroke-width> |