CSS - 右邊框寬度



設定元素右邊框的寬度。

可能的值

  • 長度 - 任何長度單位。此屬性的長度單位不能為負值。

  • thin - 比設定為 medium 的邊框更細的邊框。

  • medium - 比設定為 thin 的邊框更粗,比設定為 thick 的邊框更細的邊框。

  • thick - 比設定為 medium 的邊框更粗的邊框。

應用於

所有 HTML 元素。

DOM 語法

object.style.borderRightWidth = "2px";

示例

以下示例演示了border-right-width 屬性 -

<html>
<head>
   <style>
      h2{
           border-style: dotted;
           border-right-width: 5px;
       }
       p {border-style: solid;
          border-right-width: thin;
          }

   </style>
</head>
<body>
      <h2>border-right-width (single-side)</h2>
      <p>Different border widths on all sides. Check the width at the right of the element.</p>
</body>
</html>
廣告