美文网首页
transform-origin(变形原点)

transform-origin(变形原点)

作者: T_ttt | 来源:发表于2017-12-08 15:33 被阅读0次

简单的说transform-origin规定旋转的时候旋转的位置。transform进行的rotate,translate,scale,skew,matrix等操作都是以元素自己中心位置进行变化的。所以我们要规定下中心位置。原则如下:

top left | left top 等价于 0 0;

top | top center | center top 等价于 50% 0

right top | top right 等价于 100% 0

left | left center | center left 等价于 0 50%

center | center center 等价于 50% 50%(默认值)

right | right center | center right 等价于 100% 50%

bottom left | left bottom 等价于 0 100%

bottom | bottom center | center bottom 等价于 50% 100%

bottom right | right bottom 等价于 100% 100%

看起来很难懂简单的用一张图来说

相关文章

网友评论

      本文标题:transform-origin(变形原点)

      本文链接:https://www.haomeiwen.com/subject/vjveixtx.html