<style>
. tip{
height:10px;
padding-left:20%;
Background-color: #FFFFFF;
Text-align:center;
Line-height:: 10px;
Color: #dddcdc;
font-size:15px;
}
p:active{
Text-decoration:underline;
Color: #81A9C3;
}
. dp{
margin:0 Auto;
Text-align:center;
}
/* elements are scaled up to no effect on the surrounding elements and are completed instantaneously */
/*
img{
width:30px;
height:30px;
}
img:hover{
Transform:scale (2);
}
*/
/* Change with transition animation effect, can control the time, will affect the surrounding elements, caused by the change of the element property animation effect */
/*
img{
width:30px;
height:30px;
transition:height 2s linear 2s;
}
img:hover{
height:50px;
}
*/
/* Element height changes, will affect the surrounding elements, instantaneous completion */
/*
img{
width:30px;
height:30px;
}
img:hover{
height:50px;
}
*/
/* Keyframe Animation */
/* Keyword @keyframes to define the animation */
@keyframes demo{
0%{width:50px;height:30px}
50%{width:30px;height:50px}
100%{width:30px;height:30px}
}
/* The animation is defined and now binds the action to the element */
img:hover{
Animation:demo 2s;
}
</style>
<body>
<script>
</script>
<div>
<p class= "Tip" > No account yet? Stamp here to register </p>
</div>
<div class= "DP" >
</div>
<div>
<p class= "Tip" > No account yet? Stamp here to register </p>
</div>
</body>
Directly paste the code.
1 The simplest dynamic effect is
img:hover{
height:50px;
} is implemented by dynamic pseudo-class.
2 by the dynamic Pseudo-class trigger event, the transform to complete the dynamic effect, of course, the transform effect is much better than the former
img:hover{
Transform:scale (2);
}
3 Transition animation, this is triggered by binding element properties, because of changes in element properties, animation controllability is much higher than transform, but can only set the start and end of two frames.
4 Keyframe Animation, you can control the changes of each frame, directly bound elements can make the element animated.
The above is a personal learning experience, welcome to shoot bricks.
CSS from simple to complex dynamic effects, you deserve to have