Myreader.co.uk  
uk news, chat and community
   home   |   control panel login   |   archive   |  
 
net
net
news.announce
news.config
news.management
news.moderation
providers
providers.aaisp
web.authoring
  
 
date: Sat, 19 Jan 2008 01:05:33 +0000,    group: uk.net.web.authoring        back       
Stop IE wrongly extending elements containing floated elements   
If I have some code:

<div id="container">
        <div id="upper">
                <img>
        </div>
        <div id="lower">
</div>

and some CSS:

img     {float: left;}

then in a normal browser, the <img> will start in the upper <div>, and
extend into the lower one if it needs to. 

In IE6, the entire upper <div> thinks that it's supposed to extend to
contain the <img>, even though the latter is floated.

I know lots of workarounds which address other similar bugs in IE, but
what can I do to stop IE extending the upper <div> to contain the
floated <img>? Nothing in my toolkit does this...

Thanks,

Daniele
date: Sat, 19 Jan 2008 01:05:33 +0000   author:   (D.M. Procida)

Re: Stop IE wrongly extending elements containing floated elements   
D.M. Procida wrote:

> I know lots of workarounds which address other similar bugs in IE, but
> what can I do to stop IE extending the upper <div> to contain the
> floated <img>? Nothing in my toolkit does this...

I remember hitting up against this before. IIRC I think it's one of their 
"hasLayout" family of bugs. Try:

	.container, .container * { zoom: 1.001 }

If that doesn't fix it, I don't know what will.

A workaround of course, is to move the image out of .upper and place it 
directly in .container, but depending on what you're trying to achieve, 
that may not be possible.

-- 
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 19 days, 23:27.]

                            Ham vs Bacon vs Pork
             http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/
date: Sat, 19 Jan 2008 12:16:24 +0000   author:   Toby A Inkster

Google
 
Web myreader.co.uk


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us