如何使用 CSS 給按鈕新增彩色邊框?


要新增彩色邊框,請使用 border CSS 屬性。

示例

你可以嘗試執行以下程式碼以新增彩色邊框。

即時演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         .button {
            background-color: yellow;
            color: black;
            text-align: center;
            font-size: 15px;
            padding: 20px;
            border-radius: 15px;
            border: 3px dashed blue;
         }
      </style>
   </head>
   <body>
      <h2>Result</h2>
      <p>Click below for result:</p>
      <button class = "button">Result</button>
   </body>
</html>

更新於:2020 年 7 月 3 日

已瀏覽 799 次

開啟你的職業生涯

完成課程獲得認證

開始吧
廣告