Click here to Skip to main content
13,731,369 members
Rate this:
 
Please Sign up or sign in to vote.
See more:
I wish to animate the background-color* of an element. In this particular way:
_____________________________________
[HTML]
[head]
.example-class {animation: name 2s infinite}
@keyframes example-class {10%{color:black;}100%{color:white;}}
[/head]



[body]
[h1 class="example-class"]example text has no background color or animation.
[/h1]
[/body]
[/HTML]
_____________________________________

How do I make animation* as the background-color* for [h1]?

What I have tried:

[head]
.example-class {animation: name 2s infinite}
@keyframes example-class {10%{color:black;}100%{color:white;}}
.h1-background { background-color: "example-class" }
[/head]
Posted 7-Dec-17 12:37pm
Updated 7-Dec-17 14:47pm
v3

1 solution

Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

CSS Animatable[^] has a working example of animating background colour.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Cookies | Terms of Service
Web04-2016 | 2.8.180920.1 | Last Updated 7 Dec 2017
Copyright © CodeProject, 1999-2018
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100