Add a 2 second animation for the <div> element, which changes the color from red to blue. - HTML CSS CSS

HTML CSS examples for CSS:Quiz

Description

Add a 2 second animation for the <div> element, which changes the color from red to blue.

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<style>
div {<!--from   www.j  ava 2s  .c  o m-->
    width: 100px;
    height: 100px;
    background-color: red;
    animation-name: example;
    animation-duration: 2s;
}

@keyframes example {
    from {background-color: red;}
    to {background-color: blue;}
}
</style>
</head>
<body>

<div></div>

</body>
</html>

Related Tutorials