kevin777 Posted October 22, 2008 Share Posted October 22, 2008 Something I have always noticed but never worked out how to fix.. let me explain the situation If I have a centered 900px wide website and on page 'A' the page is vertically 400px high (don't have to scroll down to see rest of page). Now on page B the pages vertical height is 2000px height meaning you have to scroll down to see the bottom on the page - if i jump between page A and B the horizontal alignment changes because of the browser scroll bar appears on page B. My question is. How can i keep both page A and B exactly in the middle of the browser? Someone please solve this for me Thank you in advance. Quote Link to comment Share on other sites More sharing options...
F1Fan Posted October 22, 2008 Share Posted October 22, 2008 You could use overflow: scroll; in the body tag to force it to display the scroll bar all the time. Quote Link to comment Share on other sites More sharing options...
haku Posted October 23, 2008 Share Posted October 23, 2008 The only problem with that is that it will also force a horizontal scrollbar. Add this to your body (or maybe HTML? Cant remember): min-height: 100%; margin-bottom: 1px; Quote Link to comment Share on other sites More sharing options...
F1Fan Posted October 23, 2008 Share Posted October 23, 2008 Yes, but there is a way to do overflow: scroll; for only the vertical scrollbar, something like overflow-x and -y. Quote Link to comment Share on other sites More sharing options...
haku Posted October 25, 2008 Share Posted October 25, 2008 I think that's only CSS3, which isn't supported yet. Quote Link to comment Share on other sites More sharing options...
kevin777 Posted October 26, 2008 Author Share Posted October 26, 2008 Thanks for all your answers, It's solved the problem Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.