关于text-decoration

关于text-decoration

作用:text-decoration 属性规定添加到文本的修饰,下划线、上划线、删除线

text-decoration 属性是以下三种属性的简写:

  1. text-decoration-line
  2. text-decoration-color
  3. text-decoration-style
1. text-decoration-line
  • overline(上划线)
  • line-through(删除线)
  • underline(下划线)
  • blink(不建议使用)
  • inherit(继承)
  • initial(默认值)
  • unset
  • none(当然这是最重要的)
    注:blink 定义闪烁的文本。但只有Firefox能用,所以不建议使用
2. text-decoration-color
3. text-decoration-style

只有设置了text-decoration-line才有效果

描述
solid默认值。线条将显示为单线
double线条将显示为双线
dotted线条将显示为点状线
dashed线条将显示为虚线
wavy线条将显示为波浪线
initial默认值
inherit继承
4. 栗子:关键值和全局值
/*关键值*/
text-decoration: none;                     /*没有文本装饰*/
text-decoration: underline red;            /*红色下划线*/
text-decoration: underline wavy red;       /*红色波浪形下划线*/

/*全局值*/
text-decoration: inherit;
text-decoration: initial;
text-decoration: unset;
5. 栗子:虚线与波浪线
h1 {
  text-decoration: underline overline dotted red;
}
 
h2 {
  text-decoration: underline overline wavy blue;
}

在这里插入图片描述

  • 5
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值