使用 CSS 為按鈕懸停新增漸現效果


您可以嘗試執行以下程式碼,使用 CSS 為按鈕懸停新增漸現效果

示例

實際演示

<!DOCTYPE html>
<html>
   <head>
      <style>
         .btn {
            background-color: orange;
            color: white;
            padding: 10px;
            text-align: center;
            font-size: 16px;
            margin: 5px;
            opacity: 0.5;
            transition: 0.5s;
            display: inline-block;
            text-decoration: none;
            cursor: pointer;
         }
         .btn:hover {
            opacity: 2
         }
      </style>
   </head>
   <body>
      <button class = "btn">Result</button>
   </body>
</html>

更新時間:2020 年 6 月 24 日

769 次瀏覽

開啟你的 職業之旅

完成課程獲得認證

開始學習
廣告