HTML element scrollbar on the left [duplicate]

2019-06-05 22:19发布

问题:

Possible Duplicate:
DIV Vertical Scroll bar on left

is there a way with css or js to show the scrollbar of an element on the left instead of on the right? i don't need a crossbrowser way i need it only on Firefox.

回答1:

If you want the direction to be left-to-right, but still want to violate every expectation a user has to scrollbars, then you can hack it using javascript.
Simply create a 1px wide div on the left side of your content. Have it be the same height as the content which you want to scroll. Then hook up an onscroll event to that div and whenever the user scrolls that div, you can scroll the content area manually.

Some further tips: main content area needs to have overflow:hidden and you can use negative values for margin-top to fake the scrolling.



回答2:

Try

<textarea dir="rtl">

or

<body dir="rtl"> 

or

<html dir="rtl">