如何使用css修改捲軸預設樣式的代碼執行個體

來源:互聯網
上載者:User
之前因為公司項目需要,在網上找到的:

直接上代碼了

html代碼


<p class="inner">    <p class="innerbox">        <p style="height:200px;">這是內容111</p>        <p style="height:400px;">這裡是內容222</p>        <p>這裡是內容333</p>    </p></p>

css代碼


    .inner{            width: 265px;            height: 400px;            position: absolute;            top: 33px;            left: 13px;                        /*cursor: pointer;*/            overflow:hidden;        }        .innerbox{            overflow-x: hidden;            overflow-y: auto;            color: #000;            font-size: .7rem;            font-family: "\5FAE\8F6F\96C5\9ED1",Helvetica,"黑體",Arial,Tahoma;            height: 100%;        }        /*捲軸樣式*/        .innerbox::-webkit-scrollbar {/*捲軸整體樣式*/            width: 4px;     /*高寬分別對應橫豎捲軸的尺寸*/            height: 4px;        }        .innerbox::-webkit-scrollbar-thumb {/*捲軸裡面小方塊*/            border-radius: 5px;            -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);            background: rgba(0,0,0,0.2);        }        .innerbox::-webkit-scrollbar-track {/*捲軸裡面軌道*/            -webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);            border-radius: 0;            background: rgba(0,0,0,0.1);        }
相關文章

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.