vertically centering a page

liunx

Guest
Hi<br />
<br />
I've got a webpage written in basic HTML.<br />
<br />
Just wondering how to vertically center everything on the page no matter what resolution the users screen is.<br />
<br />
Can I put my webpage in a table, and then vertically center the table, or is there a way to do this with layers or something else?<br />
<br />
Thanks!<br />
<br />
Midge<!--content-->You could put it in a table, yes. That might be the least trouble. <br />
<br />
You could also have it read:<br />
<br />
<body><br />
<center><br />
Content goes here<br />
</center><br />
</body><br />
<br />
The only problem with that is that *everything* is centred, not just the page. You'd have to realign your paragraphs to "left" or they'll end up centred, too.<br />
<br />
Peg<!--content-->Originally posted by Pegasus <br />
You could put it in a table, yes. That might be the least trouble. <br />
<br />
You could also have it read:<br />
<br />
<body><br />
<center><br />
Content goes here<br />
</center><br />
</body><br />
<br />
The only problem with that is that *everything* is centred, not just the page. You'd have to realign your paragraphs to "left" or they'll end up centred, too.<br />
<br />
Peg <br />
<br />
<br />
that aligns everything horizontaly ;)<!--content-->Originally posted by celebritymusic <br />
Hi<br />
<br />
I've got a webpage written in basic HTML.<br />
<br />
Just wondering how to vertically center everything on the page no matter what resolution the users screen is.<br />
<br />
Can I put my webpage in a table, and then vertically center the table, or is there a way to do this with layers or something else?<br />
<br />
Thanks!<br />
<br />
Midge <br />
<br />
this should work in most browsers: <br />
<br />
<body><br />
<table height="100%" width="100%" cellpadding="0" cellspacing="0" border="0"><br />
<tr><br />
<td valign="middle"><br />
<br />
<div align=center><br />
center aligned content<br />
</div><br />
<p align=right><br />
right alinged content<br />
</p><br />
<br />
<br />
<table align="center" border="1"><br />
<tr><br />
<td><br />
a center aligned table<br />
</td><br />
</tr><br />
</table><br />
<br />
</td><br />
</tr><br />
</table><br />
</body><!--content-->That code should work, unless you are trying to use XHTML 1.0 Transitional or above, as then you run into a birck wall, almost. Post a reply if you are, and I can give you some tips.<!--content-->Originally posted by me_ <br />
That code should work, unless you are trying to use XHTML 1.0 Transitional or above, as then you run into a birck wall, almost. Post a reply if you are, and I can give you some tips. <br />
<br />
"I've got a webpage written in basic HTML"<!--content-->Yeah, I noticed that afterwards. :P<!--content-->
 
Back
Top