Originally Posted by Codehead
|
Here is the secret:
|
HTML Code:
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Centered Page</title>
<style type="text/css">
body {
min-width: 800px;
text-align: center;
}
#main-wrapper {
width: 800px;
margin-left: auto;
margin-right: auto;
text-align: left;
}
</style>
</head>
<body>
<div id="main-wrapper">
I'm a centered page :)
</div>
</body>
</html> |
|
Will this work in HTML 4.01 Transitional?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
Also, I'm looking to center the whole webpage on the screen, not center the text. In other words, whatever size monitor you have, your web page will be centered so if you have a really wide screen you won't have a lot of empty space to the right. Does that make sense?