text-decoration-color

Summary

The text-decoration-color CSS property sets the color used when drawing underlines, overlines, or strike-throughs specified by text-decoration-line. This is the preferred way to color these text decorations, rather than using combinations of other HTML elements.

Mit der CSS-Eigenschaft text-decoration-color kann die Farbe für Unterstreichungen, Überstreichungen oder Durchstreichungen setzen, spezifiziert durchtext-decoration-line. Das ist die bevorzugte Art und Weise mTextdekorationen eine Farbe zuzuweise,

  • Standardwert currentColor
  • Anwendbar auf Alle Elemente
  • Vererbt Nein
  • Prozentwerte
  • Medium visuell
  • Berechneter Wert If the value ist translucent, the computed value will be the rgba() corresponding one. If it isn't, it will be the rgb() corresponding one. The transparent keyword maps to rgb(0,0,0).
  • Animierbar Ja, als Farbe
  • Canonical order the unique non-ambiguous order defined by the formal grammar

Syntax

Formal syntax: <color>
text-decoration-color: currentColor
text-decoration-color: red
text-decoration-color: #00ff00
text-decoration-color: rgba(255, 128, 128, 0.5)
text-decoration-color: transparent

text-decoration-color: inherit

Values

<color>
The color property accepts various keywords and numeric notations. See <color> values for more details.

Examples

.example { 
    text-decoration: underline;
    text-decoration-color: red;
}

The example above has the same effect as the following code, which also adds a hover style.

<!DOCTYPE html>
<html>
<head>
<style>
.example {
  font-size: 24px;
  text-decoration: underline;
  color: red;
}
.example:hover {
  color: blue;
  text-decoration: line-through;
}
</style>
</head>
<body>
<span class="example">
  <span style="color:black">black text with red underline and blue hover</span>
</span>
</body>
</html>

Specifications

Specification Status Comment
CSS Text-decoration Level 3 Candidate Recommendation  

Browser compatibility

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? 6.0 (6.0)-moz ? ? ?
Feature Android Firefox mobile (Gecko) IE Phone Opera Mobile Safari Mobile
Basic support ? 6.0 (6.0)-moz ? ? ?

See also

Schlagwörter des Dokuments und Mitwirkende

Zuletzt aktualisiert von: fscholz,
Seitenleiste ausblenden