• 技术文章 >web前端 >前端问答

    css text-decoration-style属性怎么用

    藏色散人藏色散人2019-05-30 09:52:03原创1524
    css text-decoration-style属性用于规定线条如何显示,其语法是text-decoration-style: solid|double|dotted|dashed|wavy|initial|inherit。

    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>

    效果输出:

    38d2d7ac193d2215a594acff781356e.png

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

    以上就是css text-decoration-style属性怎么用的详细内容,更多请关注php中文网其它相关文章!

    声明:本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn核实处理。
    上一篇:css border-image属性怎么用 下一篇:css border-image-repeat属性怎么用

    相关文章推荐

    • css transform-style属性怎么用• css text-wrap属性怎么用• css text-outline属性怎么用• css border-image属性怎么用

    全部评论我要评论

  • 取消发布评论发送
  • 1/1

    PHP中文网