CSS 语法
text-decoration:
text-decoration-line
| 值 | 描述 |
|---|---|
| none | 默认。定义标准的文本。 |
| underline | 定义文本下的一条线。 |
| overline | 定义文本上的一条线。 |
| line-through | 定义穿过文本下的一条线。 |
| blink | 定义闪烁的文本。 |
| inherit | 规定应该从父元素继承 text-decoration 属性的值。 |
text-decoration-style
| 值 | 描述 |
|---|---|
| solid | 默认值。线条显示为单行。 |
| double | 线条显示为双线。 |
| dotted | 线条显示为点线。 |
| dashed | 线条显示为虚线。 |
| wavy | 线条显示为波浪线。 |
| initial | 将此属性设置为其默认值。 |
| inherit | 从其父元素继承此属性。 |
text-decoration-color
| 值 | 描述 |
|---|---|
| color | 规定 text-decoration 的颜色。 |
| initial | 将此属性设置为其默认值。 |
| inherit | 从其父元素继承此属性。 |
示例
.none {text-decoration: none}
.underline {text-decoration: underline}
.overline {text-decoration: overline}
.line-through {text-decoration: line-through}
.blink {text-decoration: blink}
.inherit {text-decoration: inherit}
默认
下划线
上划线
删除线
闪烁文本
从父元素继承
联合写法示例
.line-through-double-red {
text-decoration: line-through double red;
}
从父元素继承
参考
CSS text-decoration 属性
