CSS text-decoration-color 屬性
實例
改變下劃線文本中下劃線的顏色:
p
{
text-decoration: underline;
text-decoration-color: red;
-moz-text-decoration-color: red; /* 針對 Firefox 的代碼 */
}
{
text-decoration: underline;
text-decoration-color: red;
-moz-text-decoration-color: red; /* 針對 Firefox 的代碼 */
}
流覽器支持
![]()
幾乎所有的主流流覽器都不支持 text-decoration-color 屬性。
Firefox 支持另一個可替代該屬性的屬性,即 -moz-text-decoration-color 屬性。
定義和用法
text-decoration-color 屬性規定文本修飾(下劃線 underline、上劃線 overline、中劃線 line-through)的顏色。
注意:只有在帶有可見的 text-decoration 的元素上,text-decoration-color 屬性才起作用。
| 默認值: | currentColor |
|---|---|
| 繼承: | 否 |
| 可動畫化: | 是。請參閱 可動畫化(animatable)。 |
| 版本: | CSS3 |
| JavaScript 語法: | object.style.textDecorationColor="red" |
CSS 語法
text-decoration-color: color|initial|inherit;
屬性值
| 值 | 描述 | 測試 |
|---|---|---|
| color | 規定文本修飾的顏色。 | 測試 » |
| initial | 設置該屬性為它的默認值。請參閱 initial。 | 測試 » |
| inherit | 從父元素繼承該屬性。請參閱 inherit。 |

CSS 參考手冊