You are here: Re: how to vertical align a site to the center of the screen « HTML « IT news, forums, messages
Re: how to vertical align a site to the center of the screen

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 -

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация