CSS outline-style 屬性


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

  • none − 無邊框。(相當於 outline-width:0;)
  • solid − 外圍線是一條實線。
  • dotted − 外圍線是一系列點。
  • dashed − 外圍線是一系列短線。
  • double − 外圍線是兩條實線。
  • groove − 外圍線看起來好像是雕刻在頁面中的。
  • ridge − 外圍線看起來和溝槽相反。
  • inset − 外圍線使該框看起來像是嵌入在頁面中。
  • outset − 外圍線使該框看起來像是從畫布中突出出來的。
  • hidden − 等效於 none。

示例

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

<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>

更新於:2020-03-04

192 次瀏覽

開始你的職業

完成課程,獲得認證

開始
廣告
© . All rights reserved.