I want to make a DIV background (which doesn\'t have a background color) flash red then ease out to blank again. now I have used JS to add a new CLASS (which adds the red) to t
If you want something like a highlighting you may want to use CSS3 animations. They are not supported in older browsers. Check caniuse for this.
I've created a short example over here.
The highlight is called on clicking the link. Here is the CSS (without vendor-prefixes):
@keyframes highlight {
0% {
background: red
}
100% {
background: none;
}
}
#highlight:target {
animation: highlight 1s;
}