Search Results

Search found 2 results on 1 pages for 'mach77'.

Page 1/1 | 1 

  • two div boxes [1st float, 2nd clear], margin on 2nd doesn't seem to push off first

    - by mach77
    In the code below I have two div boxes. The first is float:left, the second has clear:left so that it sits below the first. My question is why does margin-top:20px not push off the first div? <head> <style> div { width:100px; height:100px; background-color:green; } #box1 { float:left; } #box2 { background-color:red; clear:left; margin-top:20px; } </style> </head> <body> <div id="box1"></div> <div id="box2"></div> </body>

    Read the article

1