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 cosmic foo on 08/05/05 01:56

"Jedi Fans" <"news[at]jedifans[--=dot==-]com"> wrote in message
news:42f11acc_1@mk-nntp-2.news.uk.tiscali.com...
> cosmic foo wrote:
> > i was just working on a similar problem.
> > the client wants the page to be filled at 800x600,
> > and centered if 1024x768.
> > so i came up with this (which i have a feeling is not so great,
> > but it seems to work in ie and firefox),
> >
> > <div id="abc" style="position: absolute; top: 0px; left: 0px; width:
> > 790px;">
> > <script language="JavaScript" type="text/javascript">
> > document.getElementById("abc").style.left = (screen.availWidth -
> > 800)/2 + "px";
> > </script>
> >
> > ..a bunch of absolute positioned divs..
> >
> > </div>
>
> <div id="abc"
>
style="position:absolute;top:50%;width:790px;margin-left:-380px;left:50%;hei
ght:500px;margin-top:-250px">
> blah blah blah. ANY content here
> </div>
>
> hth & gl...
> Kieren - btw i used to be a fixed layout person but now im a fixed width
> only person :p

good going.
is that style supposed to work or something?

 

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

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