Hi Adam,

Because floated elements are effectively removed from the flow of the
document, Firefox and Opera are (quite correctly) collapsing the height of
the containing div: it will only expand to the height of any non-flated
elements it contains.

Ironically enough, the solution to this is to use a 1px transparent gif!

Try the following:
<css>
container-div:after
{
    content: url(clear.gif);
    display: block;
    height: 0;
    clear: both;
    visibility: hidden;
}
/* Hides from IE-mac \*/
* html container-div
{
        height: 1%;
}
/* End hide from IE-mac */
</css>

...replacing "container-div" with an appropriate selector for the div which
is holding the floated elements.

Chris

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On
Behalf Of [EMAIL PROTECTED]
Sent: 15 April 2005 07:32
To: [email protected]
Subject: [WSG] Problem with floating heights

Ive made a little demo site, that shows my problem clearly
http://www.tres.dk/test

I want the container div to follow the heights of the floating elements,
#left and #right In Internet Explorer it does, but not in Firefox, Opera,
Safair or any other browser.
The height is 100% as default right ? so that's not the case here. The
margin is 0px also.
Does anyone knows what needs to be done ?

Adam DK


******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
******************************************************

********************************************************************************
   
DISCLAIMER: This e-mail is confidential and should not be used by anyone who is
not the original intended recipient. If you have received this e-mail in error
please inform the sender and delete it from your mailbox or any other storage
mechanism. Neither Macmillan Publishers Limited nor any of its agents accept
liability for any statements made which are clearly the sender's own and not
expressly made on behalf of Macmillan Publishers Limited or one of its agents.
Please note that neither Macmillan Publishers Limited nor any of its agents
accept any responsibility for viruses that may be contained in this e-mail or
its attachments and it is your responsibility to scan the e-mail and 
attachments (if any). No contracts may be concluded on behalf of Macmillan 
Publishers Limited or its agents by means of e-mail communication. Macmillan 
Publishers Limited Registered in England and Wales with registered number 
785998 
Registered Office Brunel Road, Houndmills, Basingstoke RG21 6XS   
********************************************************************************
******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
******************************************************

Reply via email to