Q:

How to animate text color on mouse hover using CSS

0

How to animate text color on mouse hover using CSS

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Use the CSS3 transition property

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.

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>

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

HTML / CSS Frequently Asked Questions

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
How to animate background-color of an element on m... >>
<< How to create 3D flipping effect on mouse hover us...