Forum Moderators: not2easy

Message Too Old, No Replies

class=clear -- why?

how come clear:both doesn't work alone?

         

sldesigns

3:38 pm on Oct 25, 2005 (gmt 0)

10+ Year Member



I'm working on a site that in pcie the footer occassionally crept up over text on the page. All pages use the same code and template, so it was strange. The footer has clear:both in the css. I added props, tried all sorts of things but the one that finally worked was to add a div with height:0 and clear:both immediately before the footer.
Why didn't the footer clear:both work on it's own?

SuzyUK

4:58 pm on Oct 25, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



height:0 and clear:both

Why.. huh cos IE is IE ;)

seriously though the height: 0; sets hasLayout to true and then IE knows better how to handle clearance and margins..this fixes a lot of IE's problems..

did you try adding just a width or height directly to the footer div? Width 100% usually does it, but sometimes with border/padding that's not possible so hacking in a small height should do it too.

sldesigns

3:24 am on Oct 27, 2005 (gmt 0)

10+ Year Member



The footer does have a height, no margin, padding or border. I tend to do the multiple-div workaround instead of worrying about the broken box -- so I have footer div with footertext div inside with the margins set.
I don't see how that could affect it, but there's obviously a lot I don't understand!
Thanks for the reply. I'll just keep trying different things until something works.

alias

9:39 am on Oct 27, 2005 (gmt 0)

10+ Year Member



If you set a fixed width to the footer itself it will be wide enough and hopefully won't try fo fit in near any floats where there is some space.

sldesigns

12:42 pm on Oct 27, 2005 (gmt 0)

10+ Year Member



Oh, I see now. The clear:both in the footer works except for pcie (mac ie was fine) because without a width, it ignored the height and didn't know how it fit in some of the pages, probably dependent on how much information was in the content divs before it.
I had seen the use of the separate clearing div before, just wasn't sure why it was needed.
Thanks to you both for the explanations.