css如何设置字体下划线


本文摘自PHP中文网,作者V,侵删。

css设置字体下划线的方法:可以利用text-decoration属性来进行设置,如【text-decoration: underline;】。text-decoration属性用于规定添加到文本的修饰、下划线、上划线、删除线等。

属性介绍:

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

(视频教程分享:css视频教程)

语法:

1

2

3

4

5

6

7

8

/*关键值*/

text-decoration: none;                     /*没有文本装饰*/

text-decoration: underline red;            /*红色下划线*/

text-decoration: underline wavy red;       /*红色波浪形下划线*/

/*全局值*/

text-decoration: inherit;

text-decoration: initial;

text-decoration: unset;

属性值:

  • none 默认。定义标准的文本。

  • underline 定义文本下的一条线。

  • overline 定义文本上的一条线。

  • line-through 定义穿过文本下的一条线。

  • blink 定义闪烁的文本。

  • inherit 规定应该从父元素继承 text-decoration 属性的值。

举例:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

h1.under {

    text-decoration: underline;

}

h1.over {

    text-decoration: overline;

}

p.line {

    text-decoration: line-through;

}

p.blink {

    text-decoration: blink;

}

a.none {

    text-decoration: none;

}

p.underover {

    text-decoration: underline overline;

}

相关推荐:CSS教程

以上就是css如何设置字体下划线的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

css top属性怎么用

详谈css的flex布局(图文介绍)

css modules 详解

css怎么让盒子并排显示

css浮动是什么

css怎么设置字体白色描边

css中怎么设置背景图

css怎么实现竖线

css为什么要放在头部呢

css是什么含义

更多相关阅读请进入《css》频道 >>




打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...