PDA

View Full Version : How To Center A Website



st05
07-16-2005, 05:49 PM
I would like to center my website. I have heard to place everything in a table and center that, but my entire website is already built. Any suggestions?

SJP
07-16-2005, 06:50 PM
<BODY><CENTER><DIV STYLE="text-align:left">
your existing HTML between the <BODY> and </BODY> tags
</DIV></CENTER></BODY>

You can't use any absolute positioning.

SJP

jalal
07-17-2005, 02:42 AM
Or:

<style>body {width:600px;margin:0 auto;}<style>

?

SJP
07-18-2005, 12:54 AM
Okay, but the closing <style> tag should read </style>.

SJP

Tom Howard
07-18-2005, 09:59 AM
So:


<style>body {width:600px; margin:0 auto;}</style>

As a side note, this goes between the head tags <head></head> in your document.