樣式 textDecoration 屬性
描述
textDecoration 屬性設定或返回文字的一個或多個裝飾。
提示:要為元素指定多種裝飾型別,請指定一個以空格分隔的裝飾型別列表。
瀏覽器支援
屬性 | |||||
---|---|---|---|---|---|
textDecoration | 是 | 是 | 是 | 是 | 是 |
語法
返回 textDecoration 屬性
object.style.textDecoration
設定 textDecoration 屬性
object.style.textDecoration = "none|underline|overline|line-through|blink|initial|inherit"
屬性值
值 | 描述 |
---|---|
none | 定義普通文字。這是預設值 |
underline | 定義文字下方的線條 |
overline | 定義文字上方的線條 |
line-through | 定義穿過文字的線條 |
initial | 將此屬性設定為其預設值。閱讀關於 initial |
inherit | 從其父元素繼承此屬性。閱讀關於 inherit |
技術詳情
預設值 | none |
---|---|
返回值 | 一個字串,表示新增到文字的裝飾 |
CSS 版本 | CSS1 |
更多示例
相關頁面
CSS 教程: CSS 文字
CSS 參考:text-decoration 屬性