- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set the speed of the hover effect with CSS
To set the speed of the hover, use the transition-duration property. To set the hover, use the :hover selector.
Example
You can try to run the following code to speed the hover effect −
<!DOCTYPE html> <html> <head> <style> .btn { background-color: yellow; color: black; text-align: center; font-size: 15px; padding: 20px; border-radius: 15px; border: 3px dashed blue; transition-duration: 2s; } .btn:hover { background-color: orange; color: black; border: 3px solid blue; } </style> </head> <body> <h2>Result</h2> <p>Click below for result:</p> <button class = "btn">Result</button> </body> </html>
- Related Articles
- How to set the speed curve of the transition effect with CSS
- Create a transition effect on hover pagination with CSS
- How to create image overlay hover effect with CSS?
- Set Mask Effect with CSS
- Set Invert Effect with CSS
- Set Grayscale Effect with CSS
- Light Speed Out Animation Effect with CSS
- Light Speed In Animation Effect with CSS
- How to create image overlay icon effect on hover with CSS?
- Set Drop Shadow Effect with CSS
- How to create an image overlay zoom effect on hover with CSS?
- Set a rounded active and hover button with CSS
- Set a delay for the CSS transition effect
- Set the name of the CSS property the transition effect is for
- Making a tilt-on-hover effect in React JS without CSS

Advertisements