How to animate text color on mouse hover using CSS
transition
You can use the CSS3 transition property to smoothly animate the text color of an element on mouseover, such as a paragraph of text or a hyperlink.
color
Let's take a look at an example to understand how it basically works:
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>CSS Smooth Animation of Element's Text Color</title> <style> a { margin: 20px; -webkit-transition: color 1s; /* For Safari 3.0 to 6.0 */ transition: color 1s; /* For modern browsers */ } a:hover { color: #ff0000; } </style> </head> <body> <h1><a href="#">Hover on me</a></h1> </body> </html>
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Use the CSS3
transitionpropertyYou can use the CSS3
transitionproperty to smoothly animate the textcolorof an element on mouseover, such as a paragraph of text or a hyperlink.Let's take a look at an example to understand how it basically works:
need an explanation for this answer? contact us directly to get an explanation for this answer