Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

DIV Vertical Scroll bar on left

Tags:

Is it possible to put DIV's Vertical Scroll bar on left of the div with css? what about jscript?

like image 799
EBAG Avatar asked Sep 21 '09 17:09

EBAG


People also ask

How do I get a vertical scroll bar in a div?

For vertical scrollable bar use the x and y axis. Set the overflow-x:hidden; and overflow-y:auto; that will automatically hide the horizontal scroll bar and present only vertical scrollbar. Here the scroll div will be vertically scrollable.

How do I change the scrollbar position?

If you want to set the scroll position of document. body , you can scroll the entire window altogether using window. scrollTo() ; it takes either a pair of coordinates (x,y) or an options object – if you just want to scroll nicely to the top, try window. scrollTo({top:0,behavior:'smooth'}); .

How do I make a div scrollable vertically and horizontally?

We can use a combination of overflow-x and overflow-y to place the scrollbar vertically, horizontally, or both. For the vertical scrollbar, overflow-x:hidden and overflow-y:auto will be set in the CSS file, and vice versa for the horizontal scrollbar.


1 Answers

I had a simple use case so opted for a simple css solution:

<div style="direction: rtl; height: 250px; overflow: scroll;">   <div style="direction: ltr; padding: 3px;">      Content goes here   </div> </div> 
like image 119
latkinson Avatar answered Dec 05 '22 00:12

latkinson