如何使用 CSS 為按鈕新增圓角?


如需為按鈕新增圓角,請使用 border-radius 屬性。

示例

您可以嘗試執行以下程式碼來新增圓角 −

實際演示

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

更新於: 2020-07-02

已檢視 2000+ 次

開啟你的 職業生涯

完成課程,獲得認證

開始
廣告