dog
06-18-2007, 02:09 PM
Hello,
I want to position my page content inside a box that sits in the centre of the browser window. Example: http://ll.dc5b.com.
In the example the box holding the page content is placed inside a td and given a 'verticle-position: middle;'. See the example below:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Example</title>
<style type="text/css">
body { text-align: center; }
table#centreHolder { height: 100%; width: 100%; }
table#centreHolder td { vertical-align: middle; }
div#containerBox {width: 600px; margin: auto; border: 1px solid black; }
</style>
</head>
<body>
<table id="centreHolder"><tr><td>
<div id="containerBox">SITE CONTENT</div>
</td></tr></table>
</body>
However when I use a 4.01 DOCTYPE it changes everything.
Example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Example</title>
<style type="text/css">
body { text-align: center; }
table#centreHolder { height: 100%; width: 100%; }
table#centreHolder td { vertical-align: middle; }
div#container {width: 600px; margin: auto; border: 1px solid black; }
</style>
</head>
<body>
<table id="centreHolder"><tr><td>
<div id="container">SITE CONTENT</div>
</td></tr></table>
</body>
Can anyone offer me an alternative way of acheiving the same effect using a 4.01 doctype?
Thanks,
dog
I want to position my page content inside a box that sits in the centre of the browser window. Example: http://ll.dc5b.com.
In the example the box holding the page content is placed inside a td and given a 'verticle-position: middle;'. See the example below:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<title>Example</title>
<style type="text/css">
body { text-align: center; }
table#centreHolder { height: 100%; width: 100%; }
table#centreHolder td { vertical-align: middle; }
div#containerBox {width: 600px; margin: auto; border: 1px solid black; }
</style>
</head>
<body>
<table id="centreHolder"><tr><td>
<div id="containerBox">SITE CONTENT</div>
</td></tr></table>
</body>
However when I use a 4.01 DOCTYPE it changes everything.
Example:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Example</title>
<style type="text/css">
body { text-align: center; }
table#centreHolder { height: 100%; width: 100%; }
table#centreHolder td { vertical-align: middle; }
div#container {width: 600px; margin: auto; border: 1px solid black; }
</style>
</head>
<body>
<table id="centreHolder"><tr><td>
<div id="container">SITE CONTENT</div>
</td></tr></table>
</body>
Can anyone offer me an alternative way of acheiving the same effect using a 4.01 doctype?
Thanks,
dog