Transform-origin (deformation origin)

Source: Internet
Author: User

Change Elemental base point Transform-origin
  • Transform-origin is the origin of the deformation, that is, the element around the point of deformation or rotation, the property only when the Transform property is set to play a role;
  • Because the default base point of our element is its central location , in other words, we do not use Transform-origin to change the position of the element base point, transform the Rotate,translate,scale,skew, The matrix and other operations are changed in the central position of the element itself .
  • But sometimes we need to perform these operations on elements in different locations, so we can use Transform-origin to change the base point position of the element so that the element base point is not in the central position to reach the base point you need.
  • Let's look at its usage rules:

    Transform-origin (x, y): the base point (reference point) used to set the motion of the element. The default point is the center point of the element. where x and Y values can be a percent, em,px, where X can also be a character parameter value left,center,right;Y and X can also set a character value in addition to a percent score top,center , Bottom .

      • Syntax:-moz-transform-origin: [| | Left | Center |  Right [| | Top | Center | Bottom]?
      • Transform-origin accepts two parameters, they can be percentages, em,px and other specific values, or it can be left,center,right, or top,center,bottom and other descriptive parameters;
      • Top Left | Left top is equivalent to 0 0;
      • Top | Top Center | Center top equivalent to 50% 0
      • Right Top | Top right is equivalent to 100% 0
      • Left | Left Center | Center left equivalent to 0 50%
      • Center | Center Center is equivalent to 50% 50% (default value)
      • Right | Right Center | Center right is equivalent to 100% 50%
      • Bottom Left | Left bottom equivalent to 0 100%
      • Bottom | Bottom Center | Center bottom equivalent to 50% 100%
      • Bottom Right | Right bottom equivalent to 100% 100%

Where left,center right is the horizontal direction value, corresponding to the score of left=0%;center=50%;right=100%

and the top center bottom is the vertical direction of the value, wherein the top=0%;center=50%;bottom=100%;

If only one value is taken, the vertical direction value is not changed .

Note: Transform-origin is not a property value in transform, he has his own syntax. But he has to combine transform to work.

Transform-origin (deformation origin)

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.