html页面中运用CSS为层添加滚动条

  1. <style type=”text/css”> 
        .scroll {  
            width: 50%;                                     /*宽度*/  
            height: 200px;                                  /*高度*/  
            color: ;                                        /*颜色*/  
            font-family: ;                                  /*字体*/  
            padding-left: 10px;                             /*层内左边距*/  
            padding-right: 10px;                            /*层内右边距*/  
            padding-top: 10px;                              /*层内上边距*/  
            padding-bottom: 10px;                           /*层内下边距*/  
            overflow-x: scroll;                             /*横向滚动条(scroll:始终出现;auto:必要时出现;具体参考CSS文档)*/  
            overflow-y: scroll;                             /*竖向滚动条*/  
              
            scrollbar-face-color: #D4D4D4;                  /*滚动条滑块颜色*/  
            scrollbar-hightlight-color: #ffffff;                /*滚动条3D界面的亮边颜色*/  
            scrollbar-shadow-color: #919192;                    /*滚动条3D界面的暗边颜色*/  
            scrollbar-3dlight-color: #ffffff;               /*滚动条亮边框颜色*/  
            scrollbar-arrow-color: #919192;                 /*箭头颜色*/  
            scrollbar-track-color: #ffffff;                 /*滚动条底色*/  
            scrollbar-darkshadow-color: #ffffff;                /*滚动条暗边框颜色*/  
        }  
        </style>
    <div class=”scroll”> 滚动内容</div>

You may also like...

发表评论