交叉轴上的对齐方式,Flex 里最常用的「垂直居中」。
<div class="ai"><i class="tall">高</i><i>中</i><i class="short">低</i></div>.ai { display: flex; align-items: center; justify-content: center; gap: 8px; height: 110px; width: 100%; background: #f6f8fc; border-radius: 10px; }
.ai i { width: 44px; background: #2b57ff; color: #fff; border-radius: 7px; display: grid; place-items: center; font: 600 10px/1 ui-monospace, monospace; font-style: normal; height: 34px; }
.ai .tall { height: 62px; background: #0d1117; }
.ai .short { height: 24px; background: #7a4bff; }