【CSS】使用CSS实现燕尾型流程图箭头

目前做的一个微信内的web系统有一个页面需要用到,查了些资料实现了,分享一下。

效果如下:


燕尾型箭头.png

这个地方呢其实主要用到了css里before和after选择器,具体代码:

div.step-container {
  display: flex;
  overflow: hidden;
  align-items: center;
}
div.step-container div.step,
div.step-container div.step2 {
  background-color: #69C795;
  position: relative;
  display: inline-block;
  flex-basis: 50px;
  height: 20px;
}
div.step-container div.step:after,
div.step-container div.step2:after {
  content: '';
  position: absolute;
  right: -10px;
  background: #69C795;
  width: 20px;
  height: 20px;
  transform: rotate(-45deg);
  z-index: 1;
  box-shadow: 3px 3px 0px 0px white;
}
div.step-container div.step2 {
  background-color: #ccc;
}
div.step-container div.step2:after {
  background: #ccc;
}
div.step-container div.step1:before {
  content: '';
  position: absolute;
  left: -10px;
  background: white;
  width: 20px;
  height: 20px;
  transform: rotate(-45deg);
  z-index: 1;
  box-shadow: 3px 3px 0px 0px white;
}

html里面布局时如下即可:

<div class="step-container" style="margin-top: 25px;">
    <div class="step step1"></div>
    <div class="step2"></div>
    <div class="step2"></div>
    <div class="step2"></div>
    <div class="step2"></div>
    <div class="step2"></div>
</div>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 概要 64学时 3.5学分 章节安排 电子商务网站概况 HTML5+CSS3 JavaScript Node 电子...
    阿啊阿吖丁阅读 9,315评论 0 3
  • 前端开发面试题 面试题目: 根据你的等级和职位的变化,入门级到专家级,广度和深度都会有所增加。 题目类型: 理论知...
    怡宝丶阅读 2,609评论 0 7
  • 1. 介绍 浏览器可能是最广泛使用的软件。本书将介绍浏览器的工作原理。我们将看到,当你在地址栏中输入google....
    康斌阅读 2,062评论 7 18
  • 【日更177】 看了《智识分子:做个复杂的现代人》一书,作者万维钢。 作者因为长期生活在美国,自己的小孩又正在当地...
    唐斩2086阅读 479评论 0 3
  • 第二课 杜甫的“诗史” 杜甫(712年—770年),字子美,汉族,本襄阳人,后徙河南巩县。自号少陵野老,唐代伟大的...
    田源ty阅读 507评论 0 1