Moving Image Effect Using CSS3

By | August 27, 2013

Moving an image using css animation effect will make website as more attractive. Here is the tutorial for moving image effect using css3 animation.

SYNTAX

animation:  animation-name |  animation-duration |  animation-iteration-count

animation-name  –  animation name, we have to define property of this animation name

animation-duration  –  speed of the effect

animation-iteration-count – Number of times the animation will works.

 

Moving Image Effect Using CSS3

Moving Image Effect Using CSS3

 

 

index.html

[code type=html]

<html>
<head>
<link rel=”stylesheet” type=”text/css” href=”style.css”>
</head>
<body>
<div class=”bg”></div>
</body>
</html>

[/code]

 

style.css

[code type=css]

.bg
{
-webkit-animation: move 30s infinite;
-moz-animation: move 30s infinite;
-ms-animation: move 30s infinite;
-o-animation: move 30s infinite;
animation: move 1s infinite;
background: url(image/bg.png);
height: 190px;
margin: -8px;

}

@-ms-keyframes move {
from {background-position:0% 0%;}
to {background-position:100% 100%;}
}
@-moz-keyframes move {
from {background-position:0% 0%;}
to {background-position:100% 100%;}
}
@-webkit-keyframes move {
from {background-position:0% 0%;}
to {background-position:100% 100%;}
}
@keyframes move {
from {background-position:0% 0%;}
to {background-position:100% 100%;}
}

[/code]

 

 

 

One thought on “Moving Image Effect Using CSS3

Leave a Reply

Your email address will not be published. Required fields are marked *