|
Posted by JD on 05/06/07 07:30
Ben C wrote:
> 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.
Great! Thanks.
Navigation:
[Reply to this message]
|