transform与transform-origin属性值介绍

1.transform是以自身元素的中心位置为基点,进行旋转。而transform-origin是改变元素的基点,默认值为50% 50%,但要使用必须先设置transform。

2.transform属性值translate(移动)、rotate(旋转)、scale(缩放)、skew(倾斜)、matrix(矩阵变换)

transform-origin属性值

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%

posted @ 2021-11-20 15:02  sjn2002  阅读(48)  评论(0)    收藏  举报