How to get a site in the middle?

admin

Administrator
Staff member
Hello guys, i need to know something.<br />
You see im making an site using a nice layout but i want that layout in the middle of the page, so that it looks nicer. If you know how to do this please say it to me!<!--content-->if you use a table, you can use align="center", if you want to do it with a div,css and xhtml, you can use margin: auto on the main div<!--content-->could you tell me how to do whit dreamweaver?<!--content-->uhh, i dont know how to do it the visual way in dreamweaver, i code everything by hand, but theres probably something in the help topics<!--content-->i'm keeping my toes crossed here in hopes you're using DW MX.<br />
<br />
click on View, then Code and Design<br />
<br />
within the top "code" find the <body> tag <br />
<br />
*note: it's likely your body tag will have additional information within it for margins, or colors for the page*<br />
<br />
and below the <body> add <center> this tag will center it on the page vertically, now to get it horizontalleyiey use this...<br />
<br />
<body><br />
<center><br />
<table><br />
<tr><br />
<td valign="middle"><br />
your page that you have now plugs in here<br />
</td><br />
</tr><br />
</table><br />
</body><br />
<br />
i hope this helps!<br />
chris<pixelmonkey>:monkey:<!--content--><body><br />
<center><br />
<table><br />
<tr><br />
<td valign="middle"><br />
your page that you have now plugs in here<br />
</td><br />
</tr><br />
</table><br />
</center><br />
</body><br />
<br />
Umm... forget something, Chris? ;)<br />
<br />
That's probably the easiest way to do it. Your best bet is to put the entire page inside a table and centre the table on the page. That way, your sliced images aren't as likely to go wandering off on their own.<br />
<br />
Peg<!--content-->a <center> tag:D<!--content-->Hmm; that would center his content, but not put it into the middle of his page ;) <br />
<br />
<body><br />
<center><br />
<table height="100%"><br />
<tr><br />
<td valign="middle"><br />
your page that you have now plugs in here<br />
</td><br />
</tr><br />
</table><br />
</center><br />
</body><br />
<br />
<br />
or leave out the <center> tags<br />
<br />
<br />
<body><br />
<table width="100%" height="100%"><br />
<tr><br />
<td valign="middle"><br />
your page that you have now plugs in here<br />
</td><br />
</tr><br />
</table><br />
</body><!--content-->No, I don't think so. If the centre tag is outside the table area, it shouldn't affect anything but how the table is set on the page. It's the table tags that govern the contents. At least, that's how it seems to work on my pages. <shrug> I could be wrong.<br />
<br />
Destrega, I've just thought of something else. Another possibility is that directly after the <body> tag you have a <div align="center"> tag, with the closing tag just before the closing body tag. Or a <span> tag aligned the same way might work.<br />
<br />
Don't quote me on it, but I think in DW, another way to get the table to centre is to put the cursor directly before the table and on the "properties" toolbar (the one that comes up for your text and such), click on the "center align" button in the right hand corner of the box. *g* Well, that's where it is in DW3. DWMx may be a bit different. It'll look just like the "center align" button in a word processor programme.<br />
<br />
Also, to make sure that the page is centered, make sure your page margins are set to zero. In DW, call up the Page Properties box and enter "0" for left margin, top margin, margin width and margin height.<br />
<br />
Peg<!--content-->Originally posted by Gregory <br />
a <center> tag:D <br />
<br />
Pixelmonkey just got his HTML 2.0 certificate ;)<!--content-->
 
Back
Top