Here is the case code for the demo,
<style>
. imlogo{
Display:block;
width:160px;
height:80px;
Background: #FF5E52 URL (/wp-content/uploads/2015/01/logo2.png) center 22px no-repeat;
-webkit-transition:background-position linear 2s;
-moz-transition:background-position linear 2s;
transition:background-position linear 2s;
}
. imlogo:hover{
background-position:center-48px;
}
</style>
<a class= "Imlogo" href= "#" ></a>
In fact, you only need to change the picture address, logo area size (160px and 80px) background map coordinates (22PX and -48px), you can achieve their own animation, if you are lazy, then do a 119*100px logo can, A picture like the one below (the background is transparent, PNG format enables code to change color).
Xiu Theme User Dynamic logo special program:
. Logo a{
-webkit-transition:background-position linear 2s;
-moz-transition:background-position linear 2s;
transition:background-position linear 2s;
}
. Logo a:hover{
background-position:center-48px;
}
In the theme of the Style.css finally add, and then make a original logo height of twice times the first replacement, and then change the 48 for your position can be, will not be calculated directly more than a few will know which is appropriate.
CSS3 Animation Instance
<!doctype html>
<meta charset= "Utf-8" >
<title> Animation </title>
<style>
H3{margin:0 auto;width:100px;}
. loading-demo{height:60px width:60px;margin:20px auto;position:relative;
. Act1,.act2{height:100%;width:100%;border-radius:50%;background: #26c1ce;p osition:absolute;top:0;left:0;
-webkit-animation:loading 2s infinite ease-in-out;
-moz-animation:loading 2s infinite ease-in-out;
animation:loading 2s infinite ease-in-out;
/* Animation name animation time cycle start last slow * *
Opacity:. 6;
}
/* Color deepened because of overlapping * *
. Act2{-webkit-animation-delay:-1s;}
@-webkit-keyframes loading{
0%,100%{-webkit-transform:scale (0.0)}
50%{-webkit-transform:scale (1.0)}
}
@-moz-keyframes loading{
0%,100%{-webkit-transform:scale (0.0)}
50%{-webkit-transform:scale (1.0)}
}
@keyframes loading{
0%,100%{-webkit-transform:scale (0.0)}
50%{-webkit-transform:scale (1.0)}
}
</style>
<div class= "Loading-demo" >
<div class= "Act1" ></div>
<div class= "Act2" ></div>
</div>
<body>