CSS:text-decoration文本装饰

本文详细介绍了CSS中text-decoration属性的使用方法,包括如何给文本添加下划线、删除线和上划线等效果,同时讲解了如何设置这些线条的颜色、样式及粗细。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

text-decoration属性可以给文本加上不同样式的下划线或者删除线
1、 text-decoration-line 线的种类:

  • underline:下划线
  • line-through:删除线
  • overline :上划线

2、text-decoration-color线的颜色

3、text-decoration-style线的样式

  • solid 实现
  • wavy 波浪线
  • dashed 虚线
  • dotted 点
  • double 双下划线

4、 text-decoration-thickness设置用于装饰的线条的粗细

/* Single keyword */
text-decoration-thickness: auto;
text-decoration-thickness: from-font;

/* length */
text-decoration-thickness: 0.1em;
text-decoration-thickness: 3px;

/* percentage */
text-decoration-thickness: 10%;

/* Global values */
text-decoration-thickness: inherit;
text-decoration-thickness: initial;
text-decoration-thickness: revert;
text-decoration-thickness: revert-layer;
text-decoration-thickness: unset;
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

无敌的黑星星

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值