目录

text-decoration

描述 (Description)

text-decoration属性用于向内联内容添加“装饰”。

可能的值 (Possible Values)

  • none - 不应在内联文本中添加任何装饰。

  • underline - 在内联文本下方绘制下划线。

  • overline - 在内联文本上方绘制一条上线。

  • line-through - 应在内联文本的中间绘制一条线。

  • blink - 内联文本应闪烁,类似于Netscape引入的BLINK元素。

适用于 (Applies to)

所有HTML元素。

DOM语法 (DOM Syntax)

object.style.textDecoration = "underline";

例子 (Example)

以下是演示如何装饰文本的示例。

NOTE - Blink属性不适用于所有浏览器。

<html>
   <head>
   </head>
   <body>
      <p <b class="notranslate">style = "text-decoration:underline;"</b>>
         This will be underlined
      </p>
      <p <b class="notranslate">style = "text-decoration:line-through;"</b>>
         This will be striked through.
      </p>
      <p <b class="notranslate">style = "text-decoration:overline;"</b>>
         This will have a over line.
      </p>
      <p <b class="notranslate">style = "text-decoration:blink;"</b>>
         This text will have blinking effect
      </p>
   </body>
</html> 

这将产生以下结果 -

新页面打开
↑回到顶部↑
WIKI教程 @2018