Forum Moderators: not2easy

Message Too Old, No Replies

firefox bug?

         

cafebabe

7:49 am on Oct 4, 2007 (gmt 0)

10+ Year Member



In the following code, as I thought, 'Left' should be at [0px, 0px], be in firefox2.0.0.7, it's [0px, 50px], how strange! Both IE6 and opera9 work as I thought. Anyone knows? thanks in advance:)


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>test</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<style type="text/css">
*{
padding:0;
margin:0;
}
</style>
</head>
<body>

<div style="float:left;width:500px;">
<div>Left</div>
</div>

<div style="margin-left:530px;">
<div style="margin-top:50px;">Right</div>
</div>

</body>
</html>

Marshall

8:23 am on Oct 4, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



cafebabe. Welcome to WebmasterWorld.

I just tested it in FF 2007 and IE7 and you are right. You can do one of three things.

Don't ask me why, but if you add:

<div style="margin-left:530px;border: 1px solid #fff;">
<div style="margin-top:50px;">Right</div>
</div>

OR

<div style="float: left; margin-left:530px;clear: left;">
<div style="margin-top:50px;">Right</div>
</div>

OR

<div style="float: left; margin-left:30px;">
<div style="margin-top:50px;">Right</div>
</div>

it solves the problem and displays the same in both. However, the third option is probably your best bet.

Marshall