css中text-decoration-style属性的作用是什么
这篇文章主要为大家详细介绍了css中text-decoration-style属性的作用是什么,文中示例代码介绍的非常详细,具有一定的参考价值,感兴趣的小伙伴们可以参考一下。
css text-decoration-style属性怎么用?
定义和用法
text-decoration-style 属性规定线条如何显示。
默认值:solid
继承:否
可动画化:否。
版本:CSS3
JavaScript 语法:
object.style.textDecorationStyle="wavy"
CSS 语法
text-decoration-style: solid|double|dotted|dashed|wavy|initial|inherit;
属性值
● solid默认值。线条将显示为单线。
● double线条将显示为双线。
● dotted线条将显示为点状线。
● dashed线条将显示为虚线。
● wavy线条将显示为波浪线。
● initial设置该属性为它的默认值。
● inherit从父元素继承该属性。
实例
在段落的下方显示一条波浪线:
<!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>
效果输出:
浏览器支持:几乎所有的主流浏览器都不支持 text-decoration-style 属性。Firefox 支持另一个可替代该属性的属性,即 -moz-text-decoration-style 属性。
关于css中text-decoration-style属性的作用是什么就分享到这里了,希望以上内容可以对大家有一定的参考价值,可以学以致用。如果喜欢本篇文章,不妨把它分享出去让更多的人看到。详细内容,更多请关注亿速云其它相关文章!
声明:本站所有文章资源内容,如无特殊说明或标注,均为采集网络资源。如若本站内容侵犯了原著者的合法权益,可联系本站删除。