Computer >> บทช่วยสอนคอมพิวเตอร์ >  >> การเขียนโปรแกรม >> CSS

สร้าง Fade In บนปุ่มเมื่อ Hover ด้วย CSS

ใช้ opacity และ transition เพื่อสร้างเอฟเฟกต์ fade in เมื่อ hover ปุ่ม

ตัวอย่าง

<!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: 1;          }       </style>    </head>    <body>       <button class = "btn">Result</button>    </body> </html>