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>
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 問答題47 /72 常見瀏覽器兼容性問題與解決方案? 參考答案 (1)瀏覽器兼容問題一:不同瀏覽器的標(biāo)簽?zāi)J(rèn)的外補(bǔ)...
    _Yfling閱讀 14,113評論 1 92
  • FreeCodeCamp - HTML5 and CSS 發(fā)現(xiàn)原來在另外一臺(tái)電腦學(xué) FreeCodeCamp 的時(shí)...
    付林恒閱讀 9,645評論 2 17
  • 學(xué)習(xí)CSS的最佳網(wǎng)站沒有之一 http://www.w3school.com.cn/tags/index.asp ...
    Amyyy_閱讀 1,181評論 0 1
  • 原文地址:http://www.w3cplus.com/PostCSS/postcss-deep-dive-sho...
    竿牘閱讀 1,951評論 1 5
  • “水哥,我們班沒水了!” “嗯,我一會(huì)兒送來。” 于是一個(gè)穿著紅色T恤,黑色短褲,赤著腳,每只手上提著兩個(gè)空水桶的...
    拾霜Nara閱讀 706評論 0 2

友情鏈接更多精彩內(nèi)容