目录

style textDecorationStyle 属性

示例

在 an 元素下显示一条波浪线:

document.getElementById("demo").style.textDecorationStyle = "wavy";
亲自试一试 »

描述

textDecorationStyle 属性设置或返回线条(如果有)的显示方式。


浏览器支持

Property
textDecorationStyle 57.0 79.0 36.0 12.1 44.0

语法

返回 textDecorationStyle 属性:

object.style.textDecorationStyle

设置 textDecorationStyle 属性:

object.style.textDecorationStyle = "solid|double|dotted|dashed|wavy|initial|inherit"

属性值

Value Description
solid Default value. The line will display as a single line
double The line will display as a double line
dotted The line will display as a dotted line
dashed The line will display as a dashed line
wavy The line will display as a wavy line
initial Sets this property to its default value. Read about initial
inherit Inherits this property from its parent element. Read about inherit

技术细节

默认值: 坚硬的
返回值: 一个 String,表示元素的 text-decoration-style 属性
CSS版本 CSS3

相关页面

CSS 参考:文本装饰样式属性