Computer >> Máy Tính >  >> Lập trình >> CSS

Làm mờ khi di chuột qua Nút bằng CSS


Bạn có thể thử chạy mã sau để làm mờ dần khi di chuột qua nút bằng CSS

Ví dụ

<!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>