CSS 属性

描述

outline-width属性定义元素周围轮廓的宽度。

属性值

  • length: 任何长度单位。此属性的长度单位不能为负。

  • thin: 比设置为中等的轮廓更细的轮廓。

  • medium: 比设置为细的轮廓更粗的轮廓,比设置为粗的轮廓更细。

  • thick: 比设置的轮廓更粗的轮廓到中等。

适用范围

所有 HTML 元素。

DOM 语法

object.style.outlineWidth = "thin"; 

示例

这是示例 -

<html>
   <head>
   </head>
   <body>
      <p style = "outline-width: 5px; outline-style: solid;  padding: 10px">
        This text is with 5px outline around it.
      </p>
      <p style = "outline-width: thin; outline-style: solid; padding: 10px">
         This text is with thin outline around it.
      </p>
      <p style = "outline-width: medium; outline-style: solid;  padding: 10px">
         This text is with medium outline around it.
      </p>
      <p style = "outline-width: thick; outline-style: solid; padding: 10px">
         This text is with thick outline around it.
      </p>

   </body>
</html>