Pages with a scrollbar moves my layout a bit. What do you do to prevent it on your pages?

[ad_1]

I noticed when clicking through my 3 tabs that the navigation jumped a bit horizontally. I found out that it was the Y-scrollbar that caused this on pages with scroll.

​

​

[Layout moves to the side when scrollbar present])

​

​

Ive found some coding band-aids, like this example, where they just force the scrollbar to always be there:

[https://stackoverflow.com/questions/1417934/how-to-prevent-scrollbar-from-repositioning-web-page])

But that does not sound like a great solution – More like a compromise, which i want to avoid. And lots of pages i visit do not have this issue at all or i would have noticed.

​

​

Someone suggests this, which i have not tried yet, but really looks like a hack that i cannot imagine everyone uses. I could barely find documentation on the issue.

​

[Untested \(for now\) hack, but do we all really need to do this to prevent jumping?])

​

I assume most sites will have pages that are a mix of scroll and no-scroll.

So how are you preventing this behaviour? Thought it would be a lot more common.

​

​

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer