开发者

Clear float among contiguous float entites in IE6

开发者 https://www.devze.com 2023-03-16 03:06 出处:网络
HTML: <div></div> <div class=\"clear\"></div> <div></div> <div></div>

HTML:

<div></div>
<div class="clear"></div>
<div></div>
<div></div>

CSS:

    div {
    background:red;
    width:50px;
    height:50px;
    margin:5px;
    float:left开发者_开发问答;
    }
    .clear {
        clear:left;
    }

Take 1,2,3,4 as div layout position in sequence.

The standards-compliant browser layout is:

1

2 3 4

while IE6 weirdly render as:

1 3 4

2

In IE6 the float entity static 'baseline' won't change even the previous element have set clear.

How to fix this bug??


IE 6 & 7 were affected by this.

Use the tried and true <br> float clearer

http://jsfiddle.net/pxfunc/ce4UK/

HTML:

<div></div>
<br class="clear" />
<div></div>
<div></div>
<div></div>

CSS:

div {
    background:red;
    width:50px;
    height:50px;
    margin:5px;
    float:left;
}
.clear {
    clear:left;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消