{"id":235,"date":"2016-05-25T07:16:39","date_gmt":"2016-05-25T07:16:39","guid":{"rendered":"http:\/\/muthu.co\/?p=235"},"modified":"2021-01-02T14:05:50","modified_gmt":"2021-01-02T14:05:50","slug":"styling-the-default-browser-scroll-bar-using-css","status":"publish","type":"post","link":"http:\/\/write.muthu.co\/styling-the-default-browser-scroll-bar-using-css\/","title":{"rendered":"Styling the default browser scroll bar using CSS"},"content":{"rendered":"

Default\u00a0Scroll Bar<\/p>\n

\"Default<\/a><\/p>\n

Add the below CSS code\u00a0to your stylesheet<\/p>\n

::-webkit-scrollbar {\r\n    width: 4px;\r\n}\r\n\r\n::-webkit-scrollbar-track {\r\n    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); \r\n}\r\n\r\n::-webkit-scrollbar-thumb {\r\n    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); \r\n}<\/pre>\n

This is what you get, a more beautiful Scroll Bar<\/p>\n

\"Default<\/a><\/p>\n


\n

 <\/p>\n

Lets add some round corners and increase the width<\/p>\n

::-webkit-scrollbar {\r\n    width: 6px;\r\n}\r\n\r\n::-webkit-scrollbar-thumb {\r\n    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.5);\r\n    -webkit-border-radius: 10px;\r\n    border-radius: 10px;\r\n}\r\n\r\n::-webkit-scrollbar-track {\r\n    -webkit-box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.3);\r\n    -webkit-border-radius: 10px;\r\n    border-radius: 10px;\r\n}<\/pre>\n

\u00a0This is what we\u00a0get<\/p>\n

\"Scroll<\/a><\/p>\n


\n

\n

Lets try to make a Mac like scroll bar<\/p>\n

::-webkit-scrollbar {\r\n width: 10px; \r\n background-color: rgba(0,0,0,0);\r\n -webkit-border-radius: 100px;\r\n}\r\n\r\n::-webkit-scrollbar:hover {\r\n background-color: rgba(0, 0, 0, 0.09);\r\n}\r\n \r\n::-webkit-scrollbar-thumb:vertical {\r\n background: rgba(0,0,0,0.5);\r\n -webkit-border-radius: 100px;\r\n background-clip: padding-box;\r\n border: 2px solid rgba(0, 0, 0, 0);\r\n min-height: 10px;\r\n}\r\n\r\n::-webkit-scrollbar-thumb:vertical:active {\r\n background: rgba(0,0,0,0.61); \r\n -webkit-border-radius: 100px;\r\n}\r\n\r\n<\/pre>\n

And here it is!<\/p>\n

\"Mac<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

Default\u00a0Scroll Bar Add the below CSS code\u00a0to your stylesheet ::-webkit-scrollbar { width: 4px; } ::-webkit-scrollbar-track { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); } ::-webkit-scrollbar-thumb { -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); } This is what you get, a more beautiful Scroll Bar   Lets add some round corners and increase the width ::-webkit-scrollbar { width: […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[23],"tags":[48],"_links":{"self":[{"href":"http:\/\/write.muthu.co\/wp-json\/wp\/v2\/posts\/235"}],"collection":[{"href":"http:\/\/write.muthu.co\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/write.muthu.co\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/write.muthu.co\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/write.muthu.co\/wp-json\/wp\/v2\/comments?post=235"}],"version-history":[{"count":1,"href":"http:\/\/write.muthu.co\/wp-json\/wp\/v2\/posts\/235\/revisions"}],"predecessor-version":[{"id":1648,"href":"http:\/\/write.muthu.co\/wp-json\/wp\/v2\/posts\/235\/revisions\/1648"}],"wp:attachment":[{"href":"http:\/\/write.muthu.co\/wp-json\/wp\/v2\/media?parent=235"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/write.muthu.co\/wp-json\/wp\/v2\/categories?post=235"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/write.muthu.co\/wp-json\/wp\/v2\/tags?post=235"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}