使用 CSS 設定下邊框樣式


要設定底邊框的樣式,請使用 border-bottom-style 屬性。可以設定邊框值的選項包括點線、雙線、虛線、實線等。

示例

你可以嘗試執行以下程式碼來自定義底邊框

線上演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         p.dotted {border-bottom-style: dotted;}
         p.double {border-bottom-style: double;}
         p.dashed {border-bottom-style: dashed;}
         p.solid {border-bottom-style: solid;}
         p.inset {border-bottom-style: inset;}
         p.outset {border-bottom-style: outset;}
      </style>
   </head>
   <body>
      <p class = "dotted">Dotted bottom border.</p>
      <p class = "double">Double bottom border.</p>
      <p class = "dashed">Dashed bottom border.</p>
      <p class = "solid">Solid bottom border.</p>
      <p class = "inset">Inset bottom border.</p>
      <p class = "outset">Outset bottom border.</p>
   </body>
</html>

輸出

更新時間:21-Jun-2020

134 次瀏覽

開啟你的 職業生涯

透過完成課程獲得認證

開始學習
廣告