樣式 textDecorationLine 屬性
描述
textDecorationLine 屬性設定或返回裝飾線(如果有)的型別。
注意:您也可以使用 textDecoration 屬性來設定 textDecorationLine,它是 textDecorationLine、textDecorationStyle 和 textDecorationColor 屬性的簡寫屬性。
注意:您還可以組合多個值,例如 underline 和 overline,以在文字下方和上方顯示線條。
瀏覽器支援
| 屬性 | |||||
|---|---|---|---|---|---|
| textDecorationLine | 57.0 | 79.0 | 36.0 | 7.0 Webkit | 44.0 |
語法
返回 textDecorationLine 屬性
object.style.textDecorationLine
設定 textDecorationLine 屬性
object.style.textDecorationLine = "none|underline|overline|line-through|initial|inherit"
屬性值
| 值 | 描述 |
|---|---|
| none | 預設值。指定文字裝飾線沒有線條 |
| underline | 指定文字下方將顯示一條線 |
| overline | 指定文字上方將顯示一條線 |
| line-through | 指定文字中間將顯示一條線 |
| initial | 將此屬性設定為其預設值。閱讀關於 initial |
| inherit | 從其父元素繼承此屬性。閱讀關於 inherit |
技術詳情
| 預設值 | none |
|---|---|
| 返回值 | 字串,表示元素的 text-decoration-line 屬性 |
| CSS 版本 | CSS3 |
相關頁面
CSS 參考: text-decoration-line 屬性