text-decoration 是CSS属性之一,用于设置文本的装饰效果,如下划线、删除线等。
下面土嘎嘎小编分享 text-decoration 属性的一些常见取值:
1、none:没有任何装饰效果。
2、underline:添加下划线效果。
3、overline:添加上划线效果。
4、line-through:添加删除线效果。
5、blink:使文本闪烁(不被所有浏览器支持)。
可以单独使用 text-decoration 属性,也可以与其他属性组合使用,例如 text-decoration: underline line-through; 表示同时添加下划线和删除线。
示例代码:
〓〓css代码如下:〓〓
/* 添加下划线效果 */
a {
text-decoration: underline;
}
/* 添加删除线效果 */
.del-text {
text-decoration: line-through;
}
上面土嘎嘎给出的例子演示了如何使用 text-decoration 属性来设置文本的装饰效果。根据需要,你可以选择适当的装饰效果来满足设计要求。