css3第一步第二步分步效果

2018-2-14 12:36| 发布者: antzone| 查看: 652| 评论: 0|来自: 蚂蚁部落

本章节分享一段代码实例,它实现了第一步、第二步这样的分步流程效果。

代码实例如下:

[HTML] 纯文本查看 复制代码运行代码
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="http://www.softwhy.com/" />
<title>蚂蚁部落</title>
<link href="" rel="stylesheet">
<style type="text/css">
.step {
  border: 1px solid #E9E9E9;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 0 4px #E9E9E9;
  width: 80%;
  margin: 50px auto;
  box-sizing: border-box;
}
.step .steps {
  display: inline-block;
  padding: 10px 10%;
  background: white;
  color: black;
  font-family: "Microsoft YaHei";
  position: relative;
  width: 25%;
  box-sizing: border-box;
  float: left;
  transition: all ease-in 0.5s;
  cursor: pointer;
}
.step .steps::after {
  position: absolute;
  content: "";
  display: block;
  height: 30px;
  width: 30px;
  background: white;
  top: 5px;
  right: -15px;
  transform: rotate(-45deg);
  transition: all ease-in 0.5s;
}
.step .steps:nth-child(1) {
  z-index: 3;
}
.step .steps:nth-child(2) {
  z-index: 2;
}
.step .steps:nth-child(3) {
  z-index: 1;
}
.step .steps:last-child::after {
  display: none;
}
.step .steps:hover, .step .steps:hover::after {
  background: #F0F0F0;
}
.step .steps:active, .step .steps:active::after {
  background: #8FA35D;
  color: white;
}
.step .steps.action {
  color: white;
  background-color: #3690CF;
}
.step .steps.action::after {
  background-color: #3690CF;
}
.step .steps:nth-child(3)::after {
  border-bottom: 1px solid #E5E5E5;
  border-right: 1px solid #E5E5E5;
}
.step .steps.disabled, .step .steps.disabled::after {
  color: #CBCBCB;
  background: white;
}
</style>
</head>
<body>
  <div class="step">
    <span class="steps">第一步</span>
    <span class="steps action">第二步</span>
    <span class="steps">第三步</span>
    <span class="steps disabled">第四步</span>
  </div>
</body>
</html>

鲜花

握手

雷人

路过

鸡蛋

最新评论

返回顶部