CSS outline-style 屬性


outline-style 屬性指定圍繞元素的邊框樣式。它可以採用以下值之一 −

  • none − 無邊框。(相當於 outline-width:0;)
  • solid − 邊框為單根實線。
  • dotted − 邊框為一系列點。
  • dashed − 邊框為一系列短線。
  • double − 邊框為兩根實線。
  • groove − 邊框看起來像是刻在頁面上。
  • ridge − 邊框看起來與凹槽相反。
  • inset − 邊框讓盒子看起來像是嵌入在頁面中。
  • outset − 邊框讓盒子看起來像是從畫布中凸出來。
  • hidden − 與 none 相同。

示例

你可以嘗試執行以下程式碼來實現 outline-style 屬性 −

<html>
   <head>
   </head>
   <body>
      <p style = "outline-width:thin; outline-style:solid;">
         This text is having thin solid outline.
      </p>
      <br />
      <p style = "outline-width:thick; outline-style:dashed;">
         This text is having thick dashed outline.
      </p>
      <br />
      <p style = "outline-width:5px;outline-style:dotted;">
         This text is having 5x dotted outline.
      </p>
   </body>
</html>

更新時間:04-Mar-2020

193 次瀏覽

事業開端

透過完成課程考取證書

開始
廣告
© . All rights reserved.