使用原生HTML和css制作一个箭头步骤条

文章目录

前言

创建一个箭头步骤条通常涉及到使用HTML来定义结构,CSS来定义样式。下面是一个简单的示例,展示了如何使用原生HTML和CSS来制作一个箭头步骤条。


一、结果展示

二、操作步骤

2.1、HTML

html 复制代码
    <div id="step-box">
        <div class="stepBar1 stepBarOne active-ba">
        	<span class="cirle">1</span>
        	<span class="font-sign active-font">阅读须知</span></div>
        <div class="stepBar1 active-ba ">
        	<span class="cirle">2</span>
        	<span class="font-sign active-font">情景选择</span>
        </div>
        <div class="stepBar1 active-ba">
        	<span class="cirle">3</span>
        	<span class="font-sign active-font">表单填写</span>
        </div>
        <div class="stepBar1">
        	<span class="cirle">4</span>
        	<span class="font-sign">材料上传</span>
        </div>
        <div class="stepBar1">
        	<span class="cirle">5</span>
        	<span class="font-sign">领取方式</span>
        </div>
        <div class="stepBar1">
        	<span class="cirle">6</span>
        	<span class="font-sign">申请成功</span>
        </div>
    </div>

2.2、CSS

css 复制代码
#step-box  {
  display: flex;
}
#step-box .cirle {
  display: inline-block;
  border-radius: 50%;
  background: #fff;
  width: 30px;
  margin: 5px 18px;
  height: 30px;
  color: #0b76c8;
  line-height: 30px;
  text-align: center;
}
.stepBar{ 
    width: 164px;
    height: 40px;
    background: #e3edf6;
    position: relative;
    line-height: 40px;
    margin: 0px 4px;
    color: #fff;
 }
.active-ba{
    background: #0b76c8;
}
.stepBar::before { 
    content:" ";
    width: 0;
    height: 0;
    border: solid;
    border-color: transparent transparent transparent #e3edf6;
    border-top-width: 20px;
    border-right-width: 20px;
    border-bottom-width: 20px;
    border-left-width: 14px;
    position: absolute;
    right: -33px;
    top: 0px;
    z-index: 1;
}
.active-ba::before{
  border-color: transparent transparent transparent #0b76c8;
}
.stepBar::after{
    content:" ";
    width: 0;
    height: 0;
    border: solid;
    border-color: transparent transparent transparent #fff;
    border-top-width: 20px;
    border-right-width: 20px;
    border-bottom-width: 20px;
    border-left-width: 14px;
    position: absolute;
    left: 0px;
    top: 0px;
}

三、感谢

如果觉得有用欢迎点赞关注。

有问题私信我!!~~

相关推荐
树上有只程序猿几秒前
低代码不是炫技,而是回归需求的必然答案
前端
比特森林探险记4 分钟前
Go 中 map 的双值检测写法详解
java·前端·golang
溪饱鱼6 分钟前
React源码阅读-fiber核心构建原理
前端·javascript·react.js
陈随易19 分钟前
Element Plus 2.10.0 重磅发布!新增Splitter组件
前端·后端·程序员
陈随易23 分钟前
2025年100个产品计划之第11个(哆啦工具箱) - 像哆啦A梦口袋一样丰富的工具箱
前端·后端·程序员
前端缘梦30 分钟前
微信小程序登录方案实践-从账号体系到用户信息存储
前端·微信小程序
用户214118326360231 分钟前
02-N8N教程-手把手教你用 PostgreSQL 实现 N8N 数据持久化,生产环境部署实战!
前端
玄玄子33 分钟前
webpack学习指南
前端·webpack·程序员
不爱说话郭德纲34 分钟前
面试官:你给我讲讲async/await
前端·深度学习·面试
前端小巷子35 分钟前
Promise 链式调用:让异步编程更优雅
前端·面试·promise