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实现动态的文字效果实例

css实现小箭头或三角形标志

css list-style-image属性怎么用

css如何修改字体为华文行楷

css定位图片位置不变的实现方法

如何使用css修改选择框样式

css怎么设置角度

css怎么设置间距

css的color属性有继承性吗?

css怎么用三种方法设置透明度

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




打赏

取消

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

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

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

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

评论

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