Vertical Scrollbar Position Absolute

Viewed 34845

Is there a way to have a cross browser vertical scrollbar with an absolute position?

My problem is that the scrollbar changes the width of my website when appears by giving some issues in my layout.

I do not want to remove it, I just want to make its width not disturbing my layout..

Thanks!

4 Answers

Since nobody has mentioned it, if you want to use overlay when it's available (e.g., Chrome & Safari) and fallback to scroll when it's not, you can use the following.

html {
  overflow-y: scroll;
  overflow-y: overlay;
}
Related