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

标签 html css

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/

相关文章:

html - 由于父容器 DIV 背景属性,CSS 过渡不起作用

javascript - jquery resize with click 函数在宽度改变时执行点击处理程序

html - 根据 HTML 页面中加载的控件加载 JS & CSS

css - 如何水平对齐 span 或 div?

html - 使用 <figure> 元素作为图标? html5

html - 使用 css-float 时元素的垂直对齐

css - 仅使用 css 增加点击时的 div 大小

html - 如何增加交叉点的 Angular ?

css - 谷歌字体 : Define custom name in CSS

javascript - 动态高度和 webkit-transition