Translate (x, y) moves both horizontally and vertically (that is, the y-axis moves simultaneously), TranslateX (x) moves horizontally (x-axis), Translatey (y) moves vertically (Y-axis movement) by default from the upper-left corner.
Here x, Y is the actual number;
When x, Y is a percentage, it is the width +padding of the moving element, and the percentage of the high +padding. Examples are as follows:
1 <!DOCTYPE HTML>2 <HTMLLang= "en">3 <Head>4 <MetaCharSet= "UTF-8">5 <title></title>6 <styletype= "Text/css">7 *{padding:0;margin:0;}8 . Demo{9 width:200px;Ten Height:150px; One background:#c66; A Color:#fff; - Padding-top:50px; - -webkit-transition:-webkit-transform 2s linear; the -moz-transition:-moz-transform 2s linear; - -ms-transition:-ms-transform 2s linear; - -o-transition:-o-transform 2s linear; - transition:transform 2s linear; + } - . Demo:hover{ + -webkit-transform:-webkit-translate (100%,100%); A -moz-transform:-moz-translate (100%,100%); at -ms-transform:-ms-translate (100%,100%); - -o-transform:-o-translate (100%,100%); - Transform:Translate (100%,100%); - } - </style> - </Head> in <Body> - <Divclass= "Demo"> to I want to know what translate (100%,100%) is. + </Div> - </Body> the </HTML>
View Code
CSS3 Translate Properties