Welcome to WebmasterWorld Guest from 54.225.38.53

Forum Moderators: not2easy

Message Too Old, No Replies

Div Float IE Bug

Problem with IE float and clear atributes on Divs

     
12:42 am on Aug 2, 2006 (gmt 0)

New User

10+ Year Member

joined:Aug 2, 2006
posts:3
votes: 0


Could you please help me out? I singled out this bug after a lot of debugging. The problem is that with IE, if i use a DIV with the clear atribute, and floating, it doesnīt generate the same output as with Firefox.

Here is the code:


<style type="text/css" media="all">
#Layer1 {
width:57px;
height:25px;
float: right;
}
#Layer2 {
width:61px;
height:28px;
float: left;
clear: right;
}
</style>
<body>
<div id="Layer1"></div>
<div id="Layer2"></div>
</body>

The two layers should appear on each side of the screen but on a different "row". Layer2 should appear, as in FF does, a bit under the line where Layer1 is, since such is the specs for the clear attribute.
While this works in FF, it doesnīt in IE.

Iīve seen this is a reported bug, but i couldnīt find any workaround for this. Can anyone give me a hand?

Thx in advance,
Albion

1:53 pm on Aug 2, 2006 (gmt 0)

New User

10+ Year Member

joined:Aug 2, 2006
posts:3
votes: 0


Solved it!
Apparently, if you donīt float left the layer that has to go to the left, IE doesnīt confuse itself. In fact, the float:left is kinda redundant if you think about it, so i guess MS ppl didnīt think of this situation, hence the bug.

I post this cuz iīve seen lots of forums where this problem gets exposed, and nobody answered.

Hope this helps some1!

Regards,
Albion

6:40 pm on Aug 8, 2006 (gmt 0)

New User

10+ Year Member

joined:July 29, 2006
posts:19
votes: 0


HI Albion,
thanks for passing it on..I'm curious, do you know if it works in other browsers, too?
I have an image in my header that I'm floating to the left of the heading but IE just drops the h1 altogether? do I float the header right?
10:43 pm on Aug 8, 2006 (gmt 0)

Junior Member

10+ Year Member

joined:May 1, 2003
posts:45
votes: 0


Apparently, if you donīt float left the layer that has to go to the left, IE doesnīt confuse itself.

Floating a div takes it out of the normal flow of the document, so of course if you don't float it, IE will behave.

More on floating divs - [css.maxdesign.com.au...]

btw, it works just fine in Opera.