text-emphasis-color

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since March 2022.

La propiedad CSS text-emphasis-color (que podría traducirse como color del texto con énfasis) define el color de las marcas de énfasis. Este valor también puede definirse usando el atajo text-emphasis

css
/* Valor inicial*/
text-emphasis-color: currentColor;

/* <color>  */
text-emphasis-color: #555;
text-emphasis-color: blue;
text-emphasis-color: rgba(90, 200, 160, 0.8);
text-emphasis-color: transparent;

/* Valores globales */
text-emphasis-color: inherit;
text-emphasis-color: initial;
text-emphasis-color: unset;
Valor inicialcurrentcolor
Applies toall elements
Heredableyes
Valor calculadocomputed color
Animation typea color

Sintáxis

Valores

<color>

Define el color de las marcas de énfasis. Si ningún color es declarado, el color por defecto es currentColor (color actual).

Sintáxis Formal

text-emphasis-color = 
<color>

Ejemplos

CSS

css
h3 {
  text-emphasis-color: #555;
  text-emphasis-style: "*";
}

HTML

html
<p>Este es un ejemplo:</p>

<h3>Esto está marcado con énfasis!</h3>

Resultado

Ejemplo incrustado en vivo

Especificaciones

Specification
CSS Text Decoration Module Level 3
# text-emphasis-color-property

Compatibilidad con navegadores

Report problems with this compatibility data on GitHub
desktopmobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
text-emphasis-color

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Requires a vendor prefix or different name for use.
Has more compatibility info.

Ver También