css横向流程条

2.png

style部分

<style type="text/css">
    #crumbs {
        text-align: center;
    }
    
    #crumbs ul {
        list-style: none;
        display: inline-table;
    }
    
    #crumbs ul li {
        display: inline;
    }
    
    #crumbs ul li a {
        display: block;
        float: left;
        height: 50px;
        background: #3498db;
        text-align: center;
        padding: 30px 10px 0 60px;
        position: relative;
        margin: 0 10px 0 0;
        font-size: 20px;
        text-decoration: none;
        color: #fff;
    }
    
    #crumbs ul li a:after {
        content: "";
        border-top: 40px solid transparent;
        border-bottom: 40px solid transparent;
        border-left: 40px solid #3498db;
        position: absolute;
        right: -40px;
        top: 0;
        z-index: 1;
    }
    
    #crumbs ul li a:before {
        content: "";
        border-top: 40px solid transparent;
        border-bottom: 40px solid transparent;
        border-left: 40px solid #d4f2ff;
        position: absolute;
        left: 0;
        top: 0;
    }
    
    #crumbs ul li:first-child a {
        border-top-left-radius: 10px;
        border-bottom-left-radius: 10px;
        padding-left: 50px;
        padding-right: 20px;
    }
    
    #crumbs ul li:first-child a:before {
        display: none;
    }
    
    #crumbs ul li:last-child a {
        padding-right: 20px;
        border-top-right-radius: 10px;
        border-bottom-right-radius: 10px;
    }
    
    #crumbs ul li:last-child a:after {
        display: none;
    }
    
    #crumbs ul li a:hover {
        background: #fa5ba5;
    }
    
    #crumbs ul li a:hover:after {
        border-left-color: #fa5ba5;
    }
</style>

html部分

<div id="crumbs">
    <ul>
        <li>
            <a href="#1">One</a>
        </li>
        <li>
            <a href="#2">Two</a>
        </li>
        <li>
            <a href="#3">Three</a>
        </li>
    </ul>
</div>
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

  • 问答题47 /72 常见浏览器兼容性问题与解决方案? 参考答案 (1)浏览器兼容问题一:不同浏览器的标签默认的外补...
    _Yfling阅读 14,302评论 1 92
  • FreeCodeCamp - HTML5 and CSS 发现原来在另外一台电脑学 FreeCodeCamp 的时...
    付林恒阅读 9,690评论 2 17
  • 学习CSS的最佳网站没有之一 http://www.w3school.com.cn/tags/index.asp ...
    Amyyy_阅读 1,212评论 0 1
  • 原文地址:http://www.w3cplus.com/PostCSS/postcss-deep-dive-sho...
    竿牍阅读 1,970评论 1 5
  • “水哥,我们班没水了!” “嗯,我一会儿送来。” 于是一个穿着红色T恤,黑色短裤,赤着脚,每只手上提着两个空水桶的...
    拾霜Nara阅读 720评论 0 2

友情链接更多精彩内容