We would like to know how to highlight with color animation.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
.sample {<!--from w w w . ja v a2s . c o m-->
padding: 20px;
background-color: #efefef;
transition: background-color 1s linear;
}
.sample:hover {
background-color: green;
}
.sample2 {
padding: 20px;
background-color: #efefef;
transition: background-color 1s linear;
}
.sample2:hover {
background-color: green;
transition: background-color 0.1s linear;
}
</style>
</head>
<body>
<section>
<h3>header</h3>
<div class="sample">this is a test.</div>
</section>
<section>
<h3>Header</h3>
<div class="sample2">this is a test.</div>
</section>
</body>
</html>
The code above is rendered as follows: