CSS3 Translate Properties

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.