CSS3美化有序列表

來源:互聯網
上載者:User

標籤:src   ges   images   splay   border   text   font   add   rem   

效果:

<ol class="rightList">                        <li>                            <span>周波</span>                            <span>19</span>                            <span><i class="iconfont icon-arrow-up-solid"></i></span>                        </li>                        <li>                            <span>王一山</span>                            <span>16</span>                            <span><i class="iconfont icon-arrow-down-solid"></i></span>                        </li>                        <li>                            <span>周波</span>                            <span>19</span>                            <span><i class="iconfont icon-minus"></i></span>                        </li>                        <li>                            <span>周波</span>                            <span>19</span>                            <span><i class="iconfont icon-arrow-up-solid"></i></span>                        </li>                        <li>                            <span>周波</span>                            <span>19</span>                            <span><i class="iconfont icon-minus"></i></span>                        </li>                                            </ol>

 

 

.rightList{                    margin-left: 180px;                    // border:2px solid red;                    // background-color: #eee;                    counter-reset: num; /* 建立一個計數器 */                                        >li{                        height:28px;                        line-height: 28px;                        padding-left:45px;                        background-color: #eee;                        margin-bottom: 4px;                        border-radius: 6px;                        position: relative;                        >span{                            display: inline-block;                            width:31%;                            // background: #fff;                            text-align: center;                        }                        >span:first-child{                            text-align: left;                        }                        .icon-arrow-up-solid{                            color:red;                            font-size: 14px;                        }                        .icon-arrow-down-solid{                            color:#78c06e;                            font-size: 14px;                        }                    }                    >li:nth-child(1){                        color:red;                    }                    >li:nth-child(1)::before{                        background-color: red;                        color:#fff;                    }                    >li:nth-child(2){                        color:#f60;                    }                    >li:nth-child(2)::before{                        background-color: #f60;                        color:#fff;                    }                    >li:nth-child(3){                        color:#5c6bc0;                    }                    >li:nth-child(3)::before{                        background-color: #5c6bc0;                        color:#fff;                    }                    >li::before{                        content: counter(num);              counter-increment: num;                         height: 28px;                         width: 28px;                         line-height: 28px;                         position: absolute;                         left: -10px;                         top: 50%;                         margin-top: -17px;                         background: #87ceeb;                         font-weight: bold;                        font-size: 13px;                                                border: 3px solid #fff;                         text-align: center;                         border-radius: 50%;                     }                    >li,                    >li::before{                        -webkit-transition: all 0.3s ease-out;                         -moz-transition: all 0.3s ease-out;                         -ms-transition: all 0.3s ease-out;                         -o-transition: all 0.3s ease-out;                         transition: all 0.3s ease-out;                    }                    >li:hover{                        background-color:#ddd;                    }                    >li:hover::before{                        left:-20px;                        // -moz-transform: rotate(360deg);                         // -webkit-transform: rotate(360deg);                         // -o-transform: rotate(360deg);                         // -ms-transform: rotate(360deg);                         // transform: rotate(360deg);                    }                }

 

CSS3美化有序列表

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.