Every web programmers knows that you can't code a commercial website for a specific browsers or user experience level, much less a screen resolution. Since you can't count on a user having the latest and greatest, you need to use the lowest common denominator of browsers resolution. In today's web world, 1024x768 is usually the lowest browser resolution coded for.
I prefer to create my websites using a fixed width so that I can have complete control over the website layout. A fixed width website looks the same in all browsers which can prevent users with extremely large or small resolutions from experiencing layout issues. Instead of simply allowing the website to align completely left on the screen (resulting in high-resolution users seeing your website take up only half their screen), I center the site. This is a very simple task.
Declare a DOCTYPE. Create an initial "wrap" DIV that will be the website's wrapper.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>My Site</title>
</head>
<body>
<!-- WEBSITE GOES HERE --> </body> </html>
Declare the "wrap" id — you MUST declare a width (otherwise, how would you center it?) Use left and right margins of "auto."
#wrap { width:900px; margin:0 auto; } /* "auto" makes the left and right margins center the wrapper */Yes! Centering your website is that easy. This website currently uses this layout. Does my website take up most of your screen? That means you have a low browser resolution.
Links:
[1] http://davidwalsh.name/horizontally-center-website-structure-css