

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to create fading buttons with CSS?
Following is the code to create fading buttons with CSS −
Example
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> button { background-color: rgb(255, 175, 222); border: none; color: black; padding: 25px; text-align: center; font-size: 20px; margin: 4px 2px; transition: 0.3s; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; font-weight: bolder; } button:hover { background-color: #4d0036; color: white; } </style> </head> <body> <h1>Fading Button Example</h1> <button>Hover Here</button> <h1>Hover on the above button to see background fade on button</h1> </body> </html>
Output
The above code will produce the following output −
On hovering the button darker background will fade in −
- Related Questions & Answers
- How to create fading effect with CSS
- How to create loading buttons with CSS?
- How to create pill buttons with CSS?
- How to create notification buttons with CSS?
- How to create icon buttons with CSS?
- Create Hoverable Buttons with CSS
- How to create custom checkboxes and radio buttons with CSS?
- How to style outline buttons with CSS?
- How to style download buttons with CSS?
- How to style text buttons with CSS?
- How to style round buttons with CSS?
- How to style social media buttons with CSS?
- How to create "next" and "previous" buttons with CSS?
- How to style "alert" buttons with CSS?
- How to style block buttons (full-width) with CSS?
Advertisements