CSS中的text-decoration属性是用来设置文本的装饰效果的,它可以用来添加下划线、删除线和上标等装饰效果。使用方法如下:
1. 为文本添加下划线:
text-decoration: underline;
2. 为文本添加删除线:
text-decoration: line-through;
3. 为文本添加上标:
text-decoration: overline;
4. 为文本添加下划线和删除线:
text-decoration: underline line-through;
5. 为文本添加下划线、删除线和上标:
text-decoration: underline line-through overline;
6. 为文本取消装饰效果:
text-decoration: none;
text-decoration属性还可以设置文本装饰效果的颜色,例如:
text-decoration-color: red;
text-decoration属性还可以设置文本装饰效果的样式,例如:
text-decoration-style: dashed;
text-decoration属性还可以设置文本装饰效果的位置,例如:
text-decoration-position: under;
text-decoration属性还可以设置文本装饰效果的间距,例如:
text-decoration-skip: ink;
text-decoration属性还可以设置文本装饰效果的模糊度,例如:
text-decoration-blur: 1px;