IE bug for clear: both;

On 1-5-2005, in Coding, CSS, by Alex

IE works very strange to clear: both;. Well, it works but sometimes you can see lost background for some other container (minimize->maximize and it’s back; or resize IE window several times) or some color’s behavior is strange.

Best cure: use position: relative; for those containers, or even use this kind of directive for all blocks (except absolute obviously). I know it is default setting but it’s true, it helps.


6 Responses to IE bug for clear: both;

  1. smugblog: Jimmy Thompson » Blog Archive » Hate … says:

    […] ell up to that point (and the fact that it was again 2am). But one google search later and I found my answer: use ‘position: relative’. So I grudgingly added one more line of code devoted to IE in […]

  2. Joerg says:

    You saved my day 🙂
    Thanks for that post and thanks to Google who puts you on the third position in the search result


  3. Ghost Bear says:

    In my case i have floated and so when i added position: relative; to container the image just disappeared. It still can be clicked but it’s not rendered.

  4. Alex says:

    Could you show the page (URL) please? There can be dozens of different causes, really.

  5. dick says:

    10x this one is nice fix.

  6. Oracle says:

    This works for me:

    .clearfix:after {
    clear: both;
    display: block;
    width: 100%;