Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS: How to change the color of the bottom right square of the scrollbar in webkit?

Tags:

html

css

webkit

Question:

How can I change the color of the bottom-right square of the scrollbar (to black) in webkit (Google-Chrome) ?

Scrollbar

This is what I have so far:

/*
http://www.coffeepowered.net/2011/06/17/sexy-css-scrollbars/
http://css-tricks.com/custom-scrollbars-in-webkit/
*/
::-webkit-scrollbar {
    width: 13px;
    height: 13px; }

::-webkit-scrollbar:hover {
    height: 18px; }

::-webkit-scrollbar-button:start:decrement,
::-webkit-scrollbar-button:end:increment 
{
    height: 15px;
    width: 13px;
    display: block;
    background: #101211;
    background-repeat: no-repeat; 
}

::-webkit-scrollbar-button:horizontal:decrement 
{
    background-image: url(./images/horizontal-decrement-arrow.png);
    background-position: 4px 3px; 
}

::-webkit-scrollbar-button:horizontal:increment 
{
    background-image: url(./images/horizontal-increment-arrow.png);
    background-position: 3px 3px; 
}

::-webkit-scrollbar-button:vertical:decrement 
{
    background-image: url(./images/vertical-decrement-arrow.png);
    background-position: 3px 4px; 
}

::-webkit-scrollbar-button:vertical:increment 
{
    background-image: url(./images/vertical-increment-arrow.png);
    background-position: 3px 4px; 
}

::-webkit-scrollbar-button:horizontal:decrement:active { background-image: url(./images/horizontal-decrement-arrow-active.png); }

::-webkit-scrollbar-button:horizontal:increment:active { background-image: url(./images/horizontal-increment-arrow-active.png); }

::-webkit-scrollbar-button:vertical:decrement:active { background-image: url(./images/vertical-decrement-arrow-active.png); }

::-webkit-scrollbar-button:vertical:increment:active { background-image: url(./images/vertical-increment-arrow-active.png); }


::-webkit-scrollbar-track 
{
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
    border-radius: 10px;
}

::-webkit-scrollbar-track-piece {
    background-color: #151716; }

::-webkit-scrollbar-thumb:vertical 
{
    height: 50px;
    background: -webkit-gradient(linear, left top, right top, color-stop(0%, #4d4d4d), color-stop(100%, #333333));
    border: 1px solid #0d0d0d;
    border-top: 1px solid #666666;
    border-left: 1px solid #666666; 
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
}

::-webkit-scrollbar-thumb:horizontal 
{
    width: 50px;
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #4d4d4d), color-stop(100%, #333333));
    border: 1px solid #1f1f1f;
    border-top: 1px solid #666666;
    border-left: 1px solid #666666; 
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5); 
}
like image 330
Stefan Steiger Avatar asked Jul 26 '12 11:07

Stefan Steiger


People also ask

How do I color my scroll bar in CSS?

The scrollbar-color property is used to set the color of an element's scrollbar. It can be used to control both the scrollbar track and scrollbar thumb colors separately. The track of a scrollbar is the background of the scrollbar which stays fixed and shows the area that can be scrolled.

How do I use WebKit scrollbar corner?

You can use the following pseudo-elements to customize various parts of the scrollbar for WebKit browsers: ::-webkit-scrollbar — the entire scrollbar. ::-webkit-scrollbar-button — the buttons on the scrollbar (arrows pointing upwards and downwards that scroll one line at a time).

Can we customize scrollbar in CSS?

In September 2018, W3C CSS Scrollbars defined specifications for customizing the appearance of scrollbars with CSS. As of 2020, 96% of internet users are running browsers that support CSS scrollbar styling. However, you will need to write two sets of CSS rules to cover Blink and WebKit and also Firefox browsers.

Can you change scroll bar color?

Generally, the scroll bar you find is usually block-shaped and gray in color. But the default color and other properties of the scroll bars can be manipulated and customized using CSS or JavaScript, or both.


1 Answers

Ah, never mind:

Answer found here

::-webkit-scrollbar-corner {
/*
background-image: url(resources/corner.png);
background-repeat: no-repeat;
*/
background-color: #3D3D3D;
}
like image 188
Stefan Steiger Avatar answered Oct 16 '22 05:10

Stefan Steiger