Create a custom scrollbar with CSS pseudo-class -webkit-scrollbar to customize color and border.
DEMO
HTML
<div class="tile--custom-scrollbar"> <div class="tile-content"> Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. </div> </div>
CSS
.tile--custom-scrollbar { overflow: auto; display: inline-block; background-color: #ccc; height: 200px; width: 300px; } .tile--custom-scrollbar::-webkit-scrollbar { width: 12px; background-color: cyan; } .tile--custom-scrollbar::-webkit-scrollbar-track{ border-radius: 3px; background-color: transparent; } .tile--custom-scrollbar::-webkit-scrollbar-thumb{ background-color:red; border:2px solid red; } .tile-content { padding: 1em; }
Comments
Post a Comment