* {
margin
:
0
;
padding
}
.main {
height
600px
width
900px
position
absolute
top
50%
left
margin-top
-300px
margin-left
-450px
.wrapper {
33.3%
100%
float
#div
1
, #div
2
3
{
150px
relative
-75px
animation-name: anim
-moz-animation-name: anim
-o-animation-name: anim
-webkit-animation-name: anim
animation-duration:
s;
-moz-animation-duration:
-o-animation-duration:
-webkit-animation-duration:
animation-iteration-count: infinite;
-moz-animation-iteration-count: infinite;
-o-animation-iteration-count: infinite;
-webkit-animation-iteration-count: infinite;
@keyframes anim
from {
background-color
#3BA9DE
to {
80px
#A3E61D
@-moz-keyframes anim
@-o-keyframes anim
@-webkit-keyframes anim
transform: scale(
1.3
,
);
-moz-transform: scale(
-o-transform: scale(
-webkit-transform: scale(
-ms-transform: scale(
#852E76
300px
520px
* { margin: 0; padding: 0; } .main { height: 600px; width: 900px; position: absolute; top: 50%; left: 50%; margin-top: -300px; margin-left: -450px; } .wrapper { width: 33.3%; height: 100%; float: left; } #div1, #div2, #div3 { height: 150px; width: 150px; float: left; position: relative; top: 50%; left: 50%; margin-top: -75px; margin-left: -75px; } #div1 { animation-name: anim1; -moz-animation-name: anim1; -o-animation-name: anim1; -webkit-animation-name: anim1; animation-duration: 3s; -moz-animation-duration: 3s; -o-animation-duration: 3s; -webkit-animation-duration: 3s; animation-iteration-count: infinite; -moz-animation-iteration-count: infinite; -o-animation-iteration-count: infinite; -webkit-animation-iteration-count: infinite; } @keyframes anim1 { from { background-color: #3BA9DE; } to { top: 80px; background-color: #A3E61D; } } @-moz-keyframes anim1 { from { background-color: #3BA9DE; } to { top: 80px; background-color: #A3E61D; } } @-o-keyframes anim1 { from { background-color: #3BA9DE; } to { top: 80px; background-color: #A3E61D; } } @-webkit-keyframes anim1 { from { background-color: #3BA9DE; } to { top: 80px; background-color: #A3E61D; } } #div2 { animation-name: anim2; -moz-animation-name: anim2; -o-animation-name: anim2; -webkit-animation-name: anim2; animation-duration: 3s; -moz-animation-duration: 3s; -o-animation-duration: 3s; -webkit-animation-duration: 3s; animation-iteration-count: infinite; -moz-animation-iteration-count: infinite; -o-animation-iteration-count: infinite; -webkit-animation-iteration-count: infinite; } @keyframes anim2 { from { background-color: #A3E61D; } to { transform: scale(1.3, 1.3); -moz-transform: scale(1.3, 1.3); -o-transform: scale(1.3, 1.3); -webkit-transform: scale(1.3, 1.3); -ms-transform: scale(1.3, 1.3); background-color: #852E76; } } @-moz-keyframes anim2 { from { background-color: #A3E61D; } to { transform: scale(1.3, 1.3); -moz-transform: scale(1.3, 1.3); -o-transform: scale(1.3, 1.3); -webkit-transform: scale(1.3, 1.3); -ms-transform: scale(1.3, 1.3); background-color: #852E76; } } @-o-keyframes anim2 { from { background-color: #A3E61D; } to { transform: scale(1.3, 1.3); -moz-transform: scale(1.3, 1.3); -o-transform: scale(1.3, 1.3); -webkit-transform: scale(1.3, 1.3); -ms-transform: scale(1.3, 1.3); background-color: #852E76; } } @-webkit-keyframes anim2 { from { background-color: #A3E61D; } to { transform: scale(1.3, 1.3); -moz-transform: scale(1.3, 1.3); -o-transform: scale(1.3, 1.3); -webkit-transform: scale(1.3, 1.3); -ms-transform: scale(1.3, 1.3); background-color: #852E76; } } #div3 { animation-name: anim3; -moz-animation-name: anim3; -o-animation-name: anim3; -webkit-animation-name: anim3; animation-duration: 3s; -moz-animation-duration: 3s; -o-animation-duration: 3s; -webkit-animation-duration: 3s; animation-iteration-count: infinite; -moz-animation-iteration-count: infinite; -o-animation-iteration-count: infinite; -webkit-animation-iteration-count: infinite; } @keyframes anim3 { from { top: 300px; background-color: #3BA9DE; } to { top: 520px; background-color: #A3E61D; } } @-moz-keyframes anim3 { from { top: 300px; background-color: #3BA9DE; } to { top: 520px; background-color: #A3E61D; } } @-o-keyframes anim3 { from { top: 300px; background-color: #3BA9DE; } to { top: 520px; background-color: #A3E61D; } } @-webkit-keyframes anim3 { from { top: 300px; background-color: #3BA9DE; } to { top: 520px; background-color: #A3E61D; } }
<!DOCTYPE html>
<
html
>
head
meta
charset
=
"utf-8"
/>
title
>New Page</
link
href
"css/style.css"
rel
"stylesheet"
</
body
div
class
"main"
"wrapper"
id
"div1"
></
"div2"
"div3"