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

Safari 16中Flexbox列方向align-items:flex-start失效问题求助

Safari中Flexbox column方向下align-items:flex-start无法左对齐的问题

我肯定哪里操作有误,这看起来是很基础的问题,但在Safari浏览器中,align-items:flex-start无法让column方向的Flexbox子元素正确左对齐。该问题在Chrome及其他浏览器中表现正常,在我们使用MUI Data Grid的应用中出现,且用简单HTML复现也得到相同结果。会不会是我的环境存在异常?

代码示例

<center>
  <div style={{width:"200px", display:"flex", flexDirection:"column", alignItems:"flex-start", justifyContent:"center", backgroundColor:"yellow"}} >
    <div style={{width:"20px", height:"20px", backgroundColor:"pink"}} > </div>
    <div style={{width:"100px", height:"20px", backgroundColor:"red"}} > </div>
    <div style={{width:"10px", height:"20px", backgroundColor:"green"}} > </div>
  </div>
</center>

显示效果

Safari中的显示效果

Safari中Flexbox子元素未左对齐的效果

Chrome中的正确显示效果

Chrome中Flexbox子元素左对齐的效果

求助!

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.06 00:35:16