w3resource
HTML exercises

CSS Properties: How to specify the animate background color?

Go to Exercise page

Solution:

HTML Code:


<!DOCTYPE html>
<html>
<head>
<title>How to specify the animate background color</title>
<style> 
#xyz {
width: 200px;
height: 150px;
background: #CC00FF;
-webkit-animation: move 8s infinite; /* Chrome, Safari, Opera */
animation: move 8s infinite;
}

/* Chrome, Safari, Opera */
@-webkit-keyframes move {
    50% {background-color: #9933CC;}
}

/* Standard syntax */
@keyframes move {
    50% {background-color: #FF33CC;}
}
</style>
</head>
<body>
<div id="xyz">w3resource Tutorial</div>
</body>
</html>

Live Demo:

See the Pen background-animate-color-answer by w3resource (@w3resource) on CodePen.


See the solution in the browser

Supported browser

Firefox logo Chrome logo Opera logo Safari logo Internet Explorer logo
Yes Yes Yes Yes No

Go to Exercise page

What is the difficulty level of this exercise?



New Content: Composer: Dependency manager for PHP, R Programming


bedava porno