Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Styling scrollbar for google chrome browser

Tags:

css

I'm trying to share some knowledge by posting some css tricks questions(and jquery tricks in another topics) and answer it.
Here I'm dealing with styling the scrollbar for google chrome browser.

like image 694
System-x32z Avatar asked Jul 05 '13 01:07

System-x32z


People also ask

How do I change the scrollbar style in Chrome?

Left-click and drag the small circle on the Scrollbar thumb color palette to select a color there. You can also choose different shades for your selected color by dragging the HSV bar sliders up and down. Drag the circle within the Scrollbar track color palette to choose a color for the track bar.

How do I customize my browser scrollbar?

We use pseudo-element (i.e., ::-webkit-scrollbar-thumb ) with -webkit prefix and set scrollbar-thumb background- color . We use box-shadow on scrollbar-track to make it stylish and add contrast between the scrollbar and scrollbar-track.

How do I add a scrollbar to Chrome?

2] Restore Settings to fix the Missing Scroll bar on ChromeIn the top-right corner of the screen, click on the 3 dots (Customize and Control Google Chrome). Choose the Settings option from the list. On the left pane, locate the Advanced option and then expand it. Scroll down click on Reset and Cleanup.

Can you style scrollbars?

The scrollbar width First, we need to define the size of the scrollbar. This can be the width for vertical scrollbars, and the height for horizontal ones. With that set, we can style the scrollbar itself.


1 Answers

Just add these CSS rules:

  1. ::-webkit-scrollbar
  2. ::-webkit-scrollbar-button
  3. ::-webkit-scrollbar-track
  4. ::-webkit-scrollbar-track-piece
  5. ::-webkit-scrollbar-thumb
  6. ::-webkit-scrollbar-corner
  7. ::-webkit-resizer

Here's what each rule does: enter image description here

like image 146
System-x32z Avatar answered Sep 24 '22 22:09

System-x32z