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