css text-decoration-style属性怎么用


本文摘自PHP中文网,作者藏色散人,侵删。

css text-decoration-style属性用于规定线条如何显示,其语法是text-decoration-style: solid|double|dotted|dashed|wavy|initial|inherit。

css text-decoration-style属性怎么用

定义和用法

text-decoration-style 属性规定线条如何显示。

默认值: solid

继承: 否

可动画化: 否。

版本: CSS3

JavaScript 语法:

1

object.style.textDecorationStyle="wavy"

CSS 语法

1

text-decoration-style: solid|double|dotted|dashed|wavy|initial|inherit;

属性值

● solid 默认值。线条将显示为单线。

● double 线条将显示为双线。

● dotted 线条将显示为点状线。

● dashed 线条将显示为虚线。

● wavy 线条将显示为波浪线。

● initial 设置该属性为它的默认值。

● inherit 从父元素继承该属性。

实例

在段落的下方显示一条波浪线:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

<!DOCTYPE html>

<html>

<head>

<style>

p

{

text-decoration: underline;

text-decoration-style: wavy;

-moz-text-decoration-style: wavy; /* 针对 Firefox 的代码 */

}

</style>

</head>

<body>

<p>

本实例中的段落文本下方会显示一条波浪线。</p>

<p><b>注意:</b>只有 Chrome 支持 text-decoration-style 属性。</p>

<p><b>注意:</b>Firefox 支持另一个可替代该属性的属性,即 -moz-text-decoration-style 属性。</p>

</body>

</html>

效果输出:

38d2d7ac193d2215a594acff781356e.png

浏览器支持:几乎所有的主流浏览器都不支持 text-decoration-style 属性。Firefox 支持另一个可替代该属性的属性,即 -moz-text-decoration-style 属性。

以上就是css text-decoration-style属性怎么用的详细内容,更多文章请关注木庄网络博客

相关阅读 >>

怎样在css中解决长英文单词的页面显示问题?

jquery怎么改变css样式

css中伪类和伪对象(伪元素)区别是什么

css中字体怎么设置

css textarea 不可拖动如何实现

css怎么让图片向左移动

css怎么设置无边框

css伪类原理是什么

css按钮如何去掉边框

css和c的区别是什么

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




打赏

取消

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

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

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

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

评论

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