Reputation: 4031
I have a div with propertie overflow auto. How to make the content of this div horizontally aligned with and without the scrollbar displayed. The scrollbar is messing with the div width. I hope you understand.
Upvotes: 0
Views: 5546
Reputation: 2909
Try using overflow-y: overlay
instead.
.your-content{
overflow-y: overlay;
}
NOTE::: overflow-y: overlay
has been deprecated.
But this will make the scrollbar appear as an overlay without affecting the width of div or element.
Upvotes: 0
Reputation: 706
overflow-x: scroll;
overflow-y: hidden;
source: Div with horizontal scrolling only
Upvotes: 1