CSS 參考手冊(cè)
設(shè)置h1,h2,h3和h4元素文本裝飾:
text-decoration 屬性規(guī)定添加到文本的修飾,下劃線、上劃線、刪除線等。
text-decoration 屬性是以下三種屬性的簡(jiǎn)寫(xiě):
/*關(guān)鍵值*/ text-decoration: none; /*沒(méi)有文本裝飾*/ text-decoration: underline red; /*紅色下劃線*/ text-decoration: underline wavy red; /*紅色波浪形下劃線*/ /*全局值*/ text-decoration: inherit; text-decoration: initial; text-decoration: unset;
默認(rèn)值: | none |
---|---|
繼承: | no |
版本: | CSS1 |
JavaScript 語(yǔ)法: | object.style.textDecoration="overline" |
表格中的數(shù)字表示支持該屬性的第一個(gè)瀏覽器版本號(hào)。
屬性 | |||||
---|---|---|---|---|---|
text-decoration | 1.0 | 3.0 | 1.0 | 1.0 | 3.5 |
值 | 描述 |
---|---|
none | 默認(rèn)。定義標(biāo)準(zhǔn)的文本。 |
underline | 定義文本下的一條線。 |
overline | 定義文本上的一條線。 |
line-through | 定義穿過(guò)文本下的一條線。 |
blink | 定義閃爍的文本。 |
inherit | 規(guī)定應(yīng)該從父元素繼承 text-decoration 屬性的值。 |
虛線與波浪線:
CSS 教程: CSS 文本