You are here: Re: 100% height container « HTML « IT news, forums, messages
Re: 100% height container

Posted by Ben C on 05/04/07 11:20

On 2007-05-04, JD <jd@example.net> wrote:
> Hi
>
> Suppose I want a container that fills the entire height of the browser
> window, regardless of the actual height.
>
> In quirks mode, you can do this:
>
><table width="70%" height="100%">
> <tr>
> <td>1</td>
> </tr>
></table>
>
> However, how do I do this using CSS in standards mode? Is it possible? This:
>
><div style="background-color: #009; height: 100%">foo</div>

Just add html, body { height: 100%; }

The 100% needs to resolve all the way up to the viewport.

"div is 100% of body which is 100% of html which is 100% of viewport
which is some known number of pixels high" makes sense. But by default
body's height depends on its content (the height of your div), which
makes the requirement for "100% of container" circular.

 

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

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