好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

text-decoration-style

CSS text-decoration-style 属性设置由属性指定的文本装饰线的样式。

通过属性可以为文本设置下划线、上划线和删除线等装饰线效果。如果某个文本同时设置了多个装饰线效果,再使用 text-decoration-style 属性为它设置装饰线的样式,那么所有装饰线的样式都是相同的。目前不能为同一个元素设置不同样式的装饰线。

通过 text-decoration-style 可以为文本设置实线、点状虚线、虚线、波浪线和双实线样式。如下图所示:

各种文本装饰线样式效果图

text-decoration-style 属性可以使用 inherit 值来继承父元素的装饰线样式。

官方语法
text-decoration-style: solid | double | dotted | dashed | wavy

参数:

solid :装饰线为一条实线。 double :装饰线为双实线。 dotted :装饰线为点状虚线。 dashed :装饰线为虚线。 wavy :装饰线为波浪线。

text-decoration-style 属性的初始值为 solid 。

应用范围

text-decoration-style 属性可以应用在所有元素上。

示例代码
text-decoration-style: solid;
text-decoration-style: double;
text-decoration-style: dotted;
text-decoration-style: dashed;
text-decoration-style: wavy;

text-decoration-style: inherit;

为一个元素红色的波浪线样式的下划线:

.example { 
    text-decoration-line: underline;
    text-decoration-style: wavy;
    text-decoration-color: red;
}  
在线演示

下面的例子演示了各种装饰线的样式(只有在Firefox6+浏览器才能够看到效果)。

双实线效果 虚线下划线效果

这是一段带点状虚线下划线效果的文字。

波浪线样式的删除线效果。

浏览器支持

目前只有Firefox 6+浏览器才支持 text-decoration-style 属性,需要添加 -moz- 前缀。

查看更多关于text-decoration-style的详细内容...

  阅读:49次

上一篇: text-decoration

下一篇:text-decoration-color

CopyRight:2016-2025好得很程序员自学网 备案ICP:湘ICP备09009000号-16 http://www.haodehen.cn
本站资讯不构成任何建议,仅限于个人分享,参考须谨慎!
本网站对有关资料所引致的错误、不确或遗漏,概不负任何法律责任。
本网站刊载的所有内容(包括但不仅限文字、图片、LOGO、音频、视频、软件、程序等)版权归原作者所有。任何单位或个人认为本网站中的内容可能涉嫌侵犯其知识产权或存在不实内容时,请及时通知本站,予以删除。

网站内容来源于网络分享,如有侵权发邮箱到:kenbest@126.com,收到邮件我们会即时下线处理。
网站框架支持:HDHCMS   51LA统计 百度统计
Copyright © 2018-2025 「好得很程序员自学网
[ SiteMap ]