Webpage moves when scroll up and down activates
I'm developing a webpage with a menu at the top. One option displays information that is not enough for the screen, so the scroll up and down activates, which is okay. But i noticed that when i clicked another option开发者_如何转开发 from the menu that has information that fits the screen, the scroll does not activate, which is okay but the webpage appears to move to the right because there is no scroll that occupies space in the window. Is this normal? It looks weird because the webpage slightly moves.
I centered my page with:
margin-left:auto
margin-right:auto
Thanks!
Problem The problem is that a webpage looks centered when the scroll is visible, when i click another link that DOES NOT need the scroll, the webpage shifts to the right because there is MORE SPACE on the screen because no scroll needs to be activated.
Try:
html {
overflow-y: scroll;
}
In your CSS if you want the vertical scroll bars to always be present.
Well, Im not 100% sure what you mean but, you can always try
"margin: auto;"
And also you could try and add a class/id to your content called "scrollable" which you could then use jQuery or raw javascript to prevent/ensure that it does scroll
精彩评论