Posted by Els on 08/03/05 16:18
Eirik Eldorsen wrote:
> I'm trying to vertical align and horisontal align my site to the center of
> the screen.
>
> I ended up with this code which seems to work in Opera, Firefox and IE:
> <body style="padding:0px;margin:0px;height:100%">
> <table cellpadding="0" cellspacing="0" style="height:98%;width:100%"
> border="0">
> <tr>
> <td valign="middle" align="center">
> THIS IS THE CENTER OF THE SCREEEN
> </td>
> </tr>
> </table>
> </body>
>
> However this is not valid html, because if I put:
> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
> "http://www.w3.org/TR/html4/loose.dtd">
> at the top of the page, the page is not centered any more.
>
> Is there a valid way to do this? (frames is not an option)
Set a height on the td.
--
Els http://locusmeus.com/
Sonhos vem. Sonhos vão. O resto é imperfeito.
- Renato Russo -
[Back to original message]
|