使用 CSS 在一個宣告中設定所有上面邊框屬性


在 CSS 中使用 border-top 屬性可在一個宣告中設定所有上面邊框屬性。

示例

你可以嘗試執行以下程式碼來實現 border-top 屬性:-

線上演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         p {
            border-style: solid;
            border-top: thick dashed #FFFF00;
         }
      </style>
   </head>
   <body>
      <p>This is demo text</p>
   </body>
</html>

更新於:2020 年 7 月 1 日

232 次瀏覽

提升您的職業生涯

完成課程以獲得認證

開始
廣告
© . All rights reserved.