Vertically Centering Webpage

This page is to be used as a demo with the Vertically Centering Webpage tutorial shows you how to perfectly center your website in the middle of the user's window. And if their window is too small, it will make sure it doesn't push the page off the screen.

Try It

Testing It on Different Window Sizes

Shrink the window really small and notice how it pushes the webpage out of view? A webpage that the user can't see or click really serves no purpose at all. So we check and fix it if the window is too small...

Reload the page then shrink the size of your window until it is smaller than 800x500px.

For a window that is too small, the script must not run or else it will push the text off the screen and make it unreadable. Now, and it won't push everything off the screen. But if you make the window big will.

Go To Tutorial