Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CSS - How to make overflow hidden on the right but not the left? [duplicate]

Possible Duplicate:
“overflow-x:hidden” one side only?

I have a container that scrolls horizontally and when the user scrolls to the left and it overflows out I want it to still show, but any time the user scrolls to the right, I want it to hide. Any suggestions?

Here's some code:

<div class="scroller">
    ... content
</div>

.scroller {
    overflow-x: scroll;
}
like image 296
ModernDesigner Avatar asked Nov 03 '22 11:11

ModernDesigner


1 Answers

In div content always starts from left to right, so make your div position:absolute and left:0; then use overflow-x: hidden; this styles only apply left side to be hide

.scroller {
   overflow-x: hidden;
   position:absolute;
   left:0;
}
like image 151
Dhamu Avatar answered Nov 15 '22 04:11

Dhamu