先來看看效果圖

話不多說,直接看實例代碼
復制代碼代碼如下:
<!DOCTYPE html>
<html>
<head>
<meta charset=”utf-8″>
<meta http-equiv=”X-UA-Compatible” content=”IE=edge,chrome=1″>
<title>CSS3實現自定義滾動條代碼</title>
<meta name=”description” content=””>
<meta name=”keywords” content=””>
<link href=”” rel=”stylesheet”>
<style type=”text/css”>
body{padding:0;margin:0;}
.box{ width:600px;height: auto;margin:0 auto; }
.scroll{ overflow:auto; width: 470px;height: 210px;padding-right: 25px; margin-top: 18px;}
.scroll p{font-family: “微軟雅黑”;font-size: 14px;color: #9F9F9F;line-height: 25px;margin-top: 20px;}
#scroll-1 {
overflow:auto;
}
#scroll-1::-webkit-scrollbar {
width:10px;
height:10px;
}
#scroll-1::-webkit-scrollbar-button {
background-color:#fff;
}
#scroll-1::-webkit-scrollbar-track {
background:#dfdfdf;
border-radius:5px;
}
#scroll-1::-webkit-scrollbar-track-piece {
}
#scroll-1::-webkit-scrollbar-thumb{
background:#F2C826;
border-radius:5px;
}
#scroll-1::-webkit-scrollbar-corner {
background:#82AFFF;
}
#scroll-1::-webkit-scrollbar-resizer {
background:#dfdfdf;
}
</style>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″></head>
<body>
<div class=”box”>
<div class=”scroll” id=”scroll-1″>
<p>無避讓立體車庫是軟件開發網斥巨資打造,公司注冊資本一個億,平臺用統一的標準多維度地展示立體車庫行業企業,購買者可以通過這個平臺就輕松了解國內外優秀立體車庫企業的產品與服務。實現停車難城市的本地化服務</p>
<p>為行業研發定制化無避讓立體車庫產品。您不必成為專家,我們為您提供差異化服務為行業帶來新的利潤增長致力于用無避讓立體車庫改善生活,領跑國內立體</p>
<p>無避讓立體車庫是軟件開發網斥巨資打造,公司注冊資本一個億,平臺用統一的標準多維度地展示立體車庫行業企業,購買者可以通過這個平臺就輕松了解國內外優秀立體車庫企業的產品與服務。實現停車難城市的本地化服務</p>
<p>為行業研發定制化無避讓立體車庫產品。您不必成為專家,我們為您提供差異化服務為行業帶來新的利潤增長致力于用無避讓立體車庫改善生活,領跑國內立體</p>
新聞熱點
疑難解答