Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I style/modify/remove scrollbars of scrollable div

Is there anyway to style, modify, or remove the scrollbars of a scrollable html div?

like image 874
Yarin Avatar asked Mar 16 '11 00:03

Yarin


People also ask

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.

How do I customize my scrollbar?

Scrollbar Selectors For webkit browsers, you can use the following pseudo elements to customize the browser's scrollbar: ::-webkit-scrollbar the scrollbar. ::-webkit-scrollbar-button the buttons on the scrollbar (arrows pointing upwards and downwards). ::-webkit-scrollbar-thumb the draggable scrolling handle.


1 Answers

I believe your only option is to remove the scrollbars altogether with CSS.

#your_div {
    overflow: hidden;
}

The scrollbars themselves are a "browser thing", and as such can't be styled.


EDIT: If you are willing to use "fake" scrollbars--i.e., they aren't actual browser scrollbars they're an HTML element created with Javascript/jQuery that work "like" scrollbars--then you can use Jscrollpane.

The scrolling looks surprisingly smooth and nice, but I would worry some about how it might work in more novel environments--i.e., a touchscreen interface.

Demos of JScrollpane.

like image 177
Chris W. Avatar answered Oct 13 '22 21:10

Chris W.