

- 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 animate buttons using CSS?
<p>Following is the code to animate buttons with CSS −</p><h2>Example</h2><p><a class="demo" href="http://tpcg.io/G7GFGc0O" rel="nofollow" target="_blank"> Live Demo</a></p><pre class="prettyprint notranslate" style=""><!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <style> button { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; position: relative; background-color: rgb(100, 0, 84); border: none; font-size: 28px; color: rgb(255, 169, 255); padding: 20px; width: 200px; text-align: center; -webkit-transition-duration: 0.4s; box-shadow: 5px 10px 18px rgb(121, 82, 185); transition-duration: 0.4s; text-decoration: none; overflow: hidden; cursor: pointer; } button:after { content: ""; background: rgb(251, 255, 0); display: block; position: absolute; padding-top: 300%; padding-left: 350%; margin-left: -20px; margin-top: -120%; opacity: 0; transition: all 0.8s } button:active:after { padding: 0; margin: 0; opacity: 1; transition: 0s } </style> </head> <body> <h1>Animated Button Example</h1> <button>Click Here</button> <h1>Click on the above button to see ripple effect</h1> </body> </html></pre><h2>Output</h2><p>The above code will produce the following output −</p><p style=""><img src="https://www.tutorialspoint.com/assets/questions/media/37037/animate_buttons.jpg" class="fr-fic fr-dib" style="width: 444px; height: 166.816px;" width="444" height="166.816"></p>
- Related Questions & Answers
- How to Animate Bullets in Lists using CSS
- Animate CSS outline
- How to style outline buttons with CSS?
- How to create fading buttons with CSS?
- How to create loading buttons with CSS?
- How to style download buttons with CSS?
- How to create pill buttons with CSS?
- How to create notification buttons with CSS?
- How to create icon buttons with CSS?
- How to style text buttons with CSS?
- How to style round buttons with CSS?
- Animate bottom CSS property
- Animate CSS flex property
- Animate CSS border property
- Animate CSS height property
Advertisements