webkit transforms: how to roate on Z axis, but not around center?

前端 未结 2 1923
自闭症患者
自闭症患者 2021-01-14 05:54

Any idea how to get the webkit transform rotation to rotate around a point different that the center of the element (e.g. around the top right corner)?

2条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-14 06:07

    Can you translate the object first, then rotate it?

    i.e. if the center of the object is at the origin and the top-right corner is at 3,5 then translate the object -3,-5 such that the top-right corner is now at the origin. Then rotate the object as normal.

提交回复
热议问题