DStewart
DStewart

Reputation: 73

How to make scroll appear on the left instead of the right? (CSS)

How would I make my scrollbar appear on the opposite side of my text? (current code makes it appear on the right.)

#words {
overflow-y: scroll;
max-height: 100px;
color:white;
margin: 30px 50px 30px 60px;
font-family: Verdana, Geneva, Tahoma, sans-serif;
font-size: smaller;
font-weight: 300;

Upvotes: 2

Views: 78

Answers (1)

Manjuboyz
Manjuboyz

Reputation: 7066

Use direction:rtl; source

fiddle to validate.

.MainDiv {
  direction: rtl;
  overflow: auto;
  height: 100px;
  width: 50px;
}
<div class="MainDiv">
  <div>list 1</div>
  <div>list 2</div>
  <div>list 3</div>
  <div>list 4</div>
  <div>list 5</div>
  <div>list 6</div>
  <div>list 7</div>
</div>

Upvotes: 3

Related Questions