可以通过添加CSS获取悬浮状态下Stepper的位置并将卡片/容器/分隔符放在其上方。
HTML代码:
This is the first step.
This is the second step.
This is the third step.
CSS代码:
.hover-card-stepper {
position: relative; /* 让步骤容器成为定位上下文 */
}
.hover-card-container {
position: absolute; /* 将容器定位到步骤容器 */
top: 0;
left: 0;
z-index: 100; /* 确保位于步骤容器之前 */
}
.hover-card {
/* 卡片/容器/分隔符样式 */
/* 可以通过JavaScript/jQuery来显示/隐藏卡片/容器/分隔符 */
}
.hover-card-stepper:hover + .hover-card-container {
/* 鼠标悬浮在步骤容器上时显示卡片/容器/分隔符 */
}