<!DOCTYPE HTML><HTMLLang= "en"><Head> <MetaCharSet= "UTF-8"> <Metaname= "Viewport"content= "Width=device-width, initial-scale=1.0"> <Metahttp-equiv= "X-ua-compatible"content= "Ie=edge"> <title>Document</title> <style>HTML{font-size:14px; }#app{background:#fff000;Height:300px;width:600px;text-align:Center;Line-height:300px; }#app: Hover{ /*Animation Keyframe Animations must have an execution time alternate to represent reverse animation*/Animation:my 2s ease infinite alternate;Border:3px Red Solid; }
/* can also be simple from{} to{}*/@keyframes my{0%{font-size:4rem;background:Red;Opacity:1; /*the parameters of a matrix function must have a unit in addition to the scale*/Transform:Translate (0px,40px) rotate (0deg) scale (1)}50%{font-size:0.5rem;Opacity:. 5;background:orangered;Transform:Translate (50px,40px) rotate (0deg) scale (0.5)}100%{font-size:1rem;Opacity:0;background:indianred;Transform:Translate (100px,40px) rotate (360deg) scale (0.3)} } </style></Head><Body> <DivID= "App"> Hi, hi.</Div></Body></HTML>
CSS3 Keyframe Animation Space transformation