top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

How to make scrollbars visible only when a Div is hovered?

+1 vote
699 views

How to make scrollbars visible only when a Div is hovered? Any sample code would be helpful?

posted Feb 17, 2016 by Salil Agrawal

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+2 votes
 
Best answer
div { overflow:hidden;height:whatever px; }
div:hover { overflow-y:scroll; }

OR

Use overflow: auto. Scrollbars will only appear when needed.

(Sidenote, you can also specify for only the x, or y scrollbar: overflow-x: auto and overflow-y: auto).

answer Feb 18, 2016 by Shivaranjini
Thanks Shivaranjini
Similar Questions
0 votes

Please provide any sample codes..

0 votes

I want to add a menu to my application screens. The menu will have the menu icons which are horizontal scroll-able one menu at a time when left or right arrow pressed.

...