css text-decoration
简介
CSS text-decoration 属性用于在文本上应用修饰效果,如下划线、删除线或上划线。
多级标题
text-decoration-line:
指定文本修饰线类型。
text-decoration-style:
指定文本修饰线的样式。
text-decoration-color:
指定文本修饰线的颜色。
内容详细说明
text-decoration-line
此属性指定文本修饰线类型。可能的值有:
none:
无修饰线。
underline:
下划线。
overline:
上划线。
line-through:
删除线。
blink:
闪烁线(不推荐使用)。
text-decoration-style
此属性指定文本修饰线的样式。可能的值有:
solid:
实线。
double:
双线。
dotted:
点线。
dashed:
虚线。
wavy:
波浪线。
text-decoration-color
此属性指定文本修饰线的颜色。它接受任何有效的 CSS 颜色值,例如:
black:
黑色
red:
红色
#00ff00:
绿色
rgb(0, 255, 0):
绿色
示例
以下示例演示了如何使用 text-decoration 属性:```css p {text-decoration: underline; }h1 {text-decoration: overline; }a {text-decoration: line-through; }span {text-decoration: none; } ```在这种情况下,段落文本将具有下划线,标题文本将具有上划线,链接文本将具有删除线,而 span 元素内的文本将没有修饰线。
浏览器支持
text-decoration 属性得到了所有主要浏览器的良好支持。
**css text-decoration****简介**CSS text-decoration 属性用于在文本上应用修饰效果,如下划线、删除线或上划线。**多级标题*** **text-decoration-line:** 指定文本修饰线类型。 * **text-decoration-style:** 指定文本修饰线的样式。 * **text-decoration-color:** 指定文本修饰线的颜色。**内容详细说明****text-decoration-line**此属性指定文本修饰线类型。可能的值有:* **none:** 无修饰线。 * **underline:** 下划线。 * **overline:** 上划线。 * **line-through:** 删除线。 * **blink:** 闪烁线(不推荐使用)。**text-decoration-style**此属性指定文本修饰线的样式。可能的值有:* **solid:** 实线。 * **double:** 双线。 * **dotted:** 点线。 * **dashed:** 虚线。 * **wavy:** 波浪线。**text-decoration-color**此属性指定文本修饰线的颜色。它接受任何有效的 CSS 颜色值,例如:* **black:** 黑色 * **red:** 红色 * **
00ff00:** 绿色 * **rgb(0, 255, 0):** 绿色**示例**以下示例演示了如何使用 text-decoration 属性:```css p {text-decoration: underline; }h1 {text-decoration: overline; }a {text-decoration: line-through; }span {text-decoration: none; } ```在这种情况下,段落文本将具有下划线,标题文本将具有上划线,链接文本将具有删除线,而 span 元素内的文本将没有修饰线。**浏览器支持**text-decoration 属性得到了所有主要浏览器的良好支持。