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:
However when I use a 4.01 DOCTYPE it changes everything.HTML Code:<!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>
Example:
Can anyone offer me an alternative way of acheiving the same effect using a 4.01 doctype?HTML Code:<!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>
Thanks,
dog



Reply With Quote



The latest well-supported DOCTYPE, and the one you should have been using for the past half a decade at least, is HTML 4.01 Strict.
Bookmarks