Scrollbars
WebKit-based browsers have a great property that allows you to style the way scroll bars look on the site with some very flexible pseudo-elements. Since these are only pseudo-elements, you can pick and choose on what element you want the custom scrollbars.
Simple Styling
By using these new pseudo-elements and some simple styling, you can create beautiful scrollbars for the body of your website.
Gradient Styling
Perhaps the flat, simple scroll bars aren't your style? here's a sample scrollbar that has a slight gradient.
Individual Elements
Do you want scrollbars only on individual elements? Some situations where this would look great are <pre>
elements, the .table-responsive
class, or anything with horizontal or vertical overflow.
Here's an example using the <pre>
element (resize the browser to see the scrollbars):
Company | Q1 | Q2 | Q3 | Q4 |
---|---|---|---|---|
Microsoft | 20.3 | 30.5 | 23.5 | 40.3 |
50.2 | 40.63 | 45.23 | 39.3 | |
Apple | 25.4 | 30.2 | 33.3 | 36.7 |
IBM | 20.4 | 15.6 | 22.3 | 29.3 |