[thelist] Trying to be as Div as possible

Joshua Olson joshua at waetech.com
Tue Nov 11 21:31:35 CST 2003


----- Original Message ----- 
From: "Mark M" <mark at safefrombees.com>
Sent: Tuesday, November 11, 2003 7:11 PM


> <div id="red" style="width: 100%; height: 100%; border: 1px solid red;">
> <table> <!--- corp header table !---> </table>
>    <div id="blue" style="width: 100%; height: 100%; border: 1px solid
blue;">
>    my real content here.
>    </div>
> </div>

> The problem with that is that the inner div (blue) also wants to be 100%
of the browser
> window, and therefore pushes the div (red) to greater than 100% of the
window - causing a
> scroll bar. What I really want is pretty much like I want the div (blue)
to be 100% -
> corpheader.height.

Mark,

Omit the width: 100% from the style declaration and the blue bordered div
will automatically fill its container, which is the div with the red border.
In general you should not specify a width if you also specify any of border,
padding, or spacing UNLESS all four are in the same units and you've
precalculated everything to make everything fit.

Is the table with the corporate logo 100% of the width or is it something
smaller.  If it's smaller then make note of its width and set the blue
bordered div accordingly.

<><><><><><><><><><>
Joshua Olson
Web Application Engineer
WAE Tech Inc.
http://www.waetech.com
706.210.0168



More information about the thelist mailing list