gpt4 book ai didi

具有事件/非事件状态和链接线的 HTML/CSS 步骤

转载 作者:太空宇宙 更新时间:2023-11-04 08:34:41 25 4
gpt4 key购买 nike

enter image description here

我正在尝试创建一个能够反射(reflect)所需设计的标记/CSS。有没有更好的方法 - 使用之前/之后的属性?

在点之间划线的最佳方式是什么

http://jsfiddle.net/39sg7f3n/3/

//html

<ul class='status'>
<li class='active'>
<h3>Call</h3>
<div class='dot'><span></span></div>
<h3>Completed</h3></li>
<li class='inactive'>
<h3>Proposal</h3>
<div class='dot'><span></span></div>
<h3>Waiting</h3></li>
<li class='inactive'>
<h3>Hire</h3>
<div class='dot'><span></span></div>
<h3>xx</h3></li>
</ul>

//CSS

ul.status {
border-top: 1px solid green;
list-style-type: none;
}

ul.status li {
float: left;
margin-right: 40px;
text-align: center;
}

ul.status li.active,
ul.status li.active h3 {
color: orange;
}

ul.status li .dot {
display: block;
width: 12px;
height: 12px;
border-radius: 12px;
background-color: grey;
margin: 0 auto;
}

ul.status li .dot span {
background: white;
width: 6px;
height: 6px;
display: block;
border-radius: 6px;
margin: 3px;
position: absolute;
}

ul.status li.active .dot {
background: orange;
}

最佳答案

ul{list-style:none;}
ul li{float:left;}
ul li.active span{color:orange;}
ul li.inactive span{color:gray;}
ul li span{display: block;position: relative;text-align: center;padding: 25px;}
ul li span:first-child:after{content: '';position: absolute;width: 10px;height: 10px;border-radius: 50%;bottom: -8px;left: calc(50% - 5px);z-index:1;}
ul li.active span:first-child:after{border: 3px solid orange;background-color: white;}
ul li.inactive span:first-child:after{border: 3px solid gray;background-color: white;}
ul li:first-child span:last-child:after{content: '';border-top: 1px solid gray;width: 50%;position: absolute;left: 50%;top: 0;}
ul li:last-child span:last-child:before{content: '';border-top: 1px solid gray;width: 50%;position: absolute;left: 0;top: 0;}
ul li:not(:last-child) span:last-child:after{content: '';border-top: 1px solid gray;width: 50%;position: absolute;left: 50%;top: 0;}
ul li:not(:first-child) span:last-child:before{content: '';border-top: 1px solid gray;width: 50%;position: absolute;left: 0;top: 0;}
<ul>
<li class="active"><span>Call</span><span>Completed</span></li>
<li class="inactive"><span>Proposal</span><span>Waiting</span></li>
<li class="inactive"><span>Hire</span><span></span></li>
</ul>

很高兴为您提供帮助。

关于具有事件/非事件状态和链接线的 HTML/CSS 步骤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44564583/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com