----- Original Message ----- 
From: "Henrik Nyh" <[EMAIL PROTECTED]>
To: <css-d@lists.css-discuss.org>
Sent: Saturday, November 15, 2008 3:30 PM
Subject: Re: [css-d] div doesn't contain img if small window,no floats 
involved

>
> I would be curious to hear if you (or anyone else) know *why* the div
> does not grow to fit without using floats.
>

Henrik:

It's the way browsers render block-level elements. Someone will correct me 
if I am wrong, but unless told otherwise (including borders, padding, and 
margins) block-level elements automatically expand in width to be 100% as 
wide as their parent, and expand in height to contain their content (there 
are exceptions to this last bit). They do not automatically expand in width 
to contain their content. The browser defaults the CSS overflow property to 
be : visible; Thus, if the content is wider than its container, as in your 
case the image is wider than (many/most) browser viewports, the overflow 
will be visible. If you want to see what happens when the browser viewport 
is wider than the image, reset you monitor resolution to be 1400px or 1600px 
wide! I didn't think overflow: hidden; was what you wanted. And yes, you 
declare that on the container, not the content.

Peter
www.fatpawdesign.com
developing in: WinXP/SP2 + FF3.0.3 at 1024x768 and 1280x1024
checking in: IE8.0beta/O9.61/Av11.6/Cr0.2/Orca1.1
In God we trust, all else bring data... 

______________________________________________________________________
css-discuss [EMAIL PROTECTED]
http://www.css-discuss.org/mailman/listinfo/css-d
List wiki/FAQ -- http://css-discuss.incutio.com/
List policies -- http://css-discuss.org/policies.html
Supported by evolt.org -- http://www.evolt.org/help_support_evolt/

Reply via email to