Click to See Complete Forum and Search --> : How do I center my websites
wgroves21
10-25-2005, 10:16 PM
I use Dreamweaver MX. I'm not as proficient at HTML as I should be. Could anyone tell me the code to center my webpages and where to place the code? I thought all I needed was <center> at the top of the body and </center> at the end, but this doesn't seem to work.
Brollachan
10-26-2005, 04:00 AM
I'd avoid using <center> tags if possible as they are deprecated in HTML 4.0 and beyond.
Instead try...
<div align="center"></div>
...or even...
<div style="text-align:center;"> </div>
kiwibrit
10-26-2005, 08:01 AM
I'd use styling, seting left and right margin widths to auto. But if IE5 users browse your site, see here (http://www.bluerobot.com/web/css/center1.html)
LiLcRaZyFuZzY
10-26-2005, 08:05 AM
assign a fixed width to the parent block element and give it an "auto" margin for both left and right
<div style="width: 800px; margin: 0 auto;">
//content
</div>
Brollachan
10-26-2005, 09:30 AM
Hang on, this is a duplicate thread, see also: http://webdeveloper.com/forum/showthread.php?t=83290