表示发展流程的圆圈和线条怎么布?
最近在做公司网页,需要做一个表示公司发展的布局,使用的一直是bootstrap5,都是把容器分区的,这个横线可就把我犯了难,在网上查阅大量资料之后,发现也没有一个合理的解释,就试着就边界线来布局。
- 代码
<!DOCTYPE html>
<html lang="zxx">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面,任何其他内容都*必须*跟随其后! -->
<title>Bootstrap 101 Template</title>
<!-- Bootstrap -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<style>
/* col-2 */
.p-process-step.p-process-style-2 .p-process-description p {
margin-bottom: 0;
}
.p-process-step.p-style-3 {
text-align: center;
position: relative;
margin-bottom: 20px;
}
.p-process-step.p-style-3 .p-step-number {
width: 80px;
height: 80px;
line-height: 80px;
background: var(--white-color);
border-radius: 50%;
color: var(--white-color);
display: inline-block;
border: solid #1764a3 6px;
}
.p-process-step.p-style-3 .p-step-number:before {
content: '';
display: inline-block;
border: 2px solid #1764a3;
width: 100%;
top: 45%;
left: 70%;
position: absolute;
}
.p-process-step.p-style-3 .p-process-info {
margin-top: 15px;
}
.p-process-step.p-style-3 .p-process-info .p-process-title {
color: #1764a3;
font-family: var(--title-fonts);
font-weight: 600;
}
.p-before-border .p-process-step.p-style-3 .p-step-number:before {
border: none
}
/* col-3 */
.q-process-step.q-process-style-2 .q-process-description p {
margin-bottom: 0;
}
.q-process-step.q-style-3 {
text-align: center;
position: relative;
margin-bottom: 20px;
}
.q-process-step.q-style-3 .q-steq-number {
width: 80px;
height: 80px;
line-height: 80px;
background: var(--white-color);
border-radius: 50%;
color: var(--white-color);
display: inline-block;
border: solid #1764a3 6px;
}
.q-process-step.q-style-3 .q-steq-number:before {
content: '';
display: inline-block;
border: 2px solid #1764a3;
width: 65%;
top: 45%;
left: 63%;
position: absolute;
}
.q-process-step.q-style-3 .q-process-info {
margin-top: 15px;
}
.q-process-step.q-style-3 .q-process-info .q-process-title {
color: #1764a3;
font-family: var(--title-fonts);
font-weight: 600;
}
.q-before-border .q-process-step.q-style-3 .q-steq-number:before {
border: none
}
@media(max-width: 1216px) {
.p-process-step.p-style-3 .p-step-number:before {
left: 74%;
}
}
@media(max-width: 1195px) {
.p-process-step.p-style-3 .p-step-number:before {
left: 75%;
}
}
@media(max-width: 1200px) {
.q-process-step.q-style-3 .q-steq-number:before {
left: 66%;
}
}
</style>
</head>
<body>
<div class="promo-wrap pt-60 " id="fzlc">
<div class="container">
<div class="row ">
<div class="col-lg-2 col-md-6">
<div class="p-process-step p-style-3 ">
<div class="p-process-media">
<div class="p-step-number" >
<img src="${base}/resources/normal/assets/img/logo.jpg" alt="" style="border-radius: 50%; margin-bottom: 10px;;border-radius:0;margin-left: 5px;" >
</div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 mt-lg-0 mt-md-0 mt-4">
<div class="q-process-step q-style-3 ">
<div class="q-process-media">
<div class="q-steq-number"> <img src="${base}/resources/normal/assets/img/24.png" alt="" style="border-radius: 50%; margin-bottom: 10px;" ></div>
</div>
</div>
</div>
<div class="col-lg-2 col-md-6 mt-lg-0 mt-4">
<div class="p-process-step p-style-3 ">
<div class="p-process-media">
<div class="p-step-number"> <div class="q-steq-number"> <img src="${base}/resources/normal/assets/img/shuimu.png" alt="" style=" margin-bottom: 15px;margin-left: 1px;padding: 10px;" ></div></div>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 mt-lg-0 mt-4">
<div class="q-process-step q-style-3 ">
<div class="q-process-media">
<div class="q-steq-number"> <img src="${base}/resources/normal/assets/img/2020.png" alt="" style=" margin-bottom: 15px;margin-left: 1px;padding: 10px;" ></div>
</div>
</div>
</div>
<div class="col-lg-2 col-md-6 mt-lg-0 mt-4 p-before-border ">
<div class="p-process-step p-style-3 ">
<div class="p-process-media">
<div class="p-step-number"> <img src="${base}/resources/normal/assets/img/24.png" alt="" style="border-radius: 50%; margin-bottom: 10px;" ></div>
</div>
</div>
</div>
</div>
<div class="row ">
<div class="col-lg-2 col-md-6">
<div class="p-process-step p-style-3 ">
<div class="p-process-info">
<h5 class="p-process-title">2009年-2017年</h5>
<p>核心技术积累与突破 <br>
'xxxxxx技术'</p>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 mt-lg-0 mt-md-0 mt-4">
<div class="q-process-step q-style-3 ">
<div class="q-process-info">
<h5 class="q-process-title">2017年</h5>
<p>子公司成立<br>
xxxxx产品转化</p>
</div>
</div>
</div>
<div class="col-lg-2 col-md-6 mt-lg-0 mt-4">
<div class="p-process-step p-style-3 ">
<div class="p-process-info">
<h5 class="p-process-title">2019年</h5>
<p> 获得水木创投融资<br></br></p>
</div>
</div>
</div>
<div class="col-lg-3 col-md-6 mt-lg-0 mt-4">
<div class="q-process-step q-style-3 ">
<div class="q-process-info">
<h5 class="q-process-title">2020年</h5>
<p>完成团队组建 <br>
首款xxxxxxxx报审</p>
</div>
</div>
</div>
<div class="col-lg-2 col-md-6 mt-lg-0 mt-4 p-before-border ">
<div class="p-process-step p-style-3 ">
<div class="p-process-info">
<h5 class="p-process-title">2021年</h5>
<p>持续进行产品及技术研发 <br>
xxxxxxx取得注册证</p>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
2.效果呈现(圆圈直接加图)
3.总结
bootstrap布局还是很灵活,用content的边界线布局这条蓝线有点障眼法的感觉,尤其在屏幕适配的部分显得很呆板,需要非常细的调整(现在我也想不出更好的的qwq),尤其在奇数个圆圈的时候还要考虑怎么分配这12个区块(我这里是2+3+2+3)。
本人刚刚入门,还望大家多多指教!(觉得有帮助,点个赞哈哈哈哈)