这是基本思想
您在 ul 或 li 标签下创建三个 li 列表
你使 li 标签位置:相对;并给予一些左侧填充
li { height: 40px; padding-left: 20px; display: flex; align-items: center; position: relative; }
你使用 li::before css 属性并设置左边框。
li::before { content: ''; position: absolute; left: -16px; border-left: 2px solid black; height: 100%; width: 1px; }
现在你使用 li::after css 属性并在它周围画三个圆圈
li::after { content: ''; display: inline-block; height: 10px; width: 10px; border-radius: 50%; background-color: blue; margin-left: -80px; }
现在终于从第一个和最后一个列表中裁剪该行
li:first-child:before { top: 20px; } li:last-child:before { top: -20px; }
结果:
完整代码:
html:
css:
li { height: 40px; padding-left: 20px; display: flex; align-items: center; position: relative; } li::before { content: ''; position: absolute; left: -16px; border-left: 2px solid black; height: 100%; width: 1px; } li::after { content: ''; display: inline-block; height: 10px; width: 10px; border-radius: 50%; background-color: blue; margin-left: -80px; } li:first-child:before { top: 20px; } li:last-child:before { top: -20px; }
免责声明: 提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发到邮箱:[email protected] 我们会第一时间内为您处理。
Copyright© 2022 湘ICP备2022001581号-3