Translate X and Y percentage values based on elements height and width?

前端 未结 9 1741
情歌与酒
情歌与酒 2020-12-08 03:29

Translating an elements Y axis 50% will move it down 50% of its own height, not 50% of the parents height as I would expect. How do I tell a translating element to base it\'

9条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-08 04:05

    You can make the element absolute positioned and use left and top property to take the percentage value as parent.

提交回复
热议问题