所有柱子现在精确对齐轴线,无论容器高度如何变化都保持准确
top:50%;transform:translateY(-50%)
bottom:calc(50% - 高度px)
top:50%
flex:1;min-height:0
轴线(用 transform 精确居中):
<div style="position:absolute;left:0;right:0;top:50%;transform:translateY(-50%);height:1px;background:#d1d5db;z-index:1"></div>柱子定位(从轴线开始延伸):
<div style="bottom:calc(50% - {高度}px);height:{高度}px;background:#d7263d;..."></div>
<div style="top:50%;height:{高度}px;background:#16a34a;..."></div>已修改的技能文件:
修改内容:
top:50%;transform:translateY(-50%)bottom:calc(50% - {高度}px)top:50%top:50%;transform:translateY(-50%)