You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用translateX导致transform-origin旋转轴偏移的技术问题咨询

问题现象

使用translateX时,transform-origin指定的旋转轴会从top center偏移为top right。所有容器的尺寸与子元素完全一致。

效果演示动图

CSS 代码

#arrow {
    position: absolute;

    left: 50%;
    bottom: 0;

    transform-origin: top center;
    transform: rotate(0deg) translateX(-50%);
}

HTML 代码

<div id="depth">
   <img id="sensorImg" src="https://cdn.discordapp.com/attachments/282502094202732544/1000456309793116170/Depth_Flattened.svg" alt="depth">    
   <img id="arrow" src="https://cdn.discordapp.com/attachments/282502094202732544/1000670507890389062/Polygon.png"> 
</div>

内容的提问来源于stack exchange,提问作者HasanTheSyrian_

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.24 22:36:34