html - Unexplained space near top of document in FireFox only -


i'm having issue margin being applied div seems getting applied document body in firefox only.

some googling around internet seems make reference collapsing margins, , while may case, don't think understand what's going on.

i've created example http://jsfiddle.net/davidwkennedy/3bqrw/ (view in ff, , other browser compare).

   <body>   <form id="form1" action="nothing">      <div>         <div>            <p style="float:left; border:solid 1px red">why text not anchored @ top of page?</p>            <div style="clear:both;"> </div>         </div>      </div>      <div style="margin-top:100px;">         <p>hello world</p>      </div>   </form> 

could please me understand what's going on?

thanks

(edit: it's been while since asked this, wanted update firefox version. don't recall using when wrote this, issue still occurring in 26.0)

it related collapsing margins. add overflow:auto form , you'll see issue disappear.

jsfiddle example


Comments

Popular posts from this blog

ios - iPhone/iPad different view orientations in different views , and apple approval process -

java Extracting Zip file -

C# WinForm - loading screen -