CSS 流程处理的圆线拼接效果

先看效果图:

Paste_Image.png

当然这个效果是按横排列的,我们先看简单的html布局(图标是SVG图):

<div class="content-line">
        <i class="icon-Processnode"></i><div class="follow-up-route"></div>
        <i class="icon-Processnode"></i><div class="follow-up-route"></div>
        <i class="icon-done"></i>
</div>
<div class="content-text">
        <span class="content-title">提交申请</span>
        <span class="content-title">银行处理中</span>
        <span class="content-title">已到账</span>
</div>
<div class="content-text-time">
        <span class="content-time">2016-03-24 08:00</span>
        <span class="content-time">2016-03-25 09:00</span>
        <span class="content-time">2016-03-26 10:00</span>
</div>

基本上简单的CSS样式是采用flex做布局,通过flex=1去做拉伸比例适配

.content-line{
        .flex-layout(center);
        .flex-vertical();
        color: #5FC423;
        margin-bottom: 10px;
        margin-left: 55px;
        margin-right: 55px;
}
.content-text, .content-text-time{
        .flex-layout(center);
        .flex-vertical();
        color: #5FC423;
        text-align: center;
}
.content-text-time{
        margin-bottom: 20px;
}
 .content-title{
        color: #333;
        font-size: 13px;
        flex: 1;
}
.content-time{
        color: #B1B1B1;
        font-size: 10px;
        flex: 1;
}

.follow-up-route{
        height: 1px;
        background: #5FC423;
        flex: 1;
}

因为用到了flex,所以把居中的flex抽了出来,工具css方法其实是这样的:

// 伸缩盒

.flex-layout(@align:center) {
  display: -webkit-box;
  display: -webkit-flex;
  display: -moz-box;
  display: -moz-flex;
  display: -ms-flexbox;
  display: flex;
  -moz-box-align:@align;
  -webkit-box-align:@align;
  -webkit-box-align: @align;
  -moz-box-align: @align;
  -ms-flex-align:@align;
  -webkit-justify-content: @align;
  -moz-justify-content: @align;
  justify-content: @align;

}

.flex-vertical() {
  -webkit-box-pack: center;
  -moz-box-pack: center;
  -ms-flex-pack:center;
  -webkit-align-items: center;
  -moz-align-items: center;
  align-items: center;
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Android 自定义View的各种姿势1 Activity的显示之ViewRootImpl详解 Activity...
    passiontim阅读 174,489评论 25 709
  • 问答题47 /72 常见浏览器兼容性问题与解决方案? 参考答案 (1)浏览器兼容问题一:不同浏览器的标签默认的外补...
    _Yfling阅读 13,862评论 1 92
  • 前言 温馨提示:本文较长,图片较多,本来是想写一篇 CSS 布局方式的,但是奈何 CSS 布局方式种类太多并且实现...
    sunshine小小倩阅读 3,201评论 0 59
  • 突然想起有人跟我说过她写的三行诗,第一行是这样写到的“我,你”,我想是代表着相识前的两个人在两条不同的平行线上永远...
    汤wan仪阅读 342评论 0 4
  • 1. 中午在超市,听到一个妈妈跟大约6岁的女儿说,以后找老公要找上海、杭州、北京这种大城市的,因为他们有钱。 小女...
    就是陶陶阅读 365评论 0 2