| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN"> |
| <html lang="en"> |
| <head> |
| <title>Margin Collapsing: effect of margins on collapsing-through</title> |
| <style type="text/css"> |
| td { border: solid; background: red; padding: 0; font: 3em/1 Ahem; } |
| .bg { background: orange; color: yellow; } |
| .a { margin: 0 0 1em 0; background: lime; } |
| .c { margin: 1em 0 0 0; background: aqua; } |
| .b1 { margin: 1em 0 1em 0; } |
| .b2 { margin: 0em 0 1em 0; } |
| .b3 { margin: 1em 0 0em 0; } |
| .b4 { margin: 0em 0 0em 0; } |
| .b5 { margin: 0.5em 0 0.5em 0; } |
| .b6 { margin: 0em 0 0.5em 0; } |
| .b7 { margin: 0.5em 0 0em 0; } |
| .control .a { margin: 0 0 1em 0; } |
| .control .c { margin: 0; } |
| </style> |
| </head> |
| <body> |
| <p>All the following should look the same (and all should look like |
| the first).</p> |
| <table> |
| <tr> |
| <td class="control"> |
| <div class="bg"> |
| <div class="a">A</div> |
| <div class="c">C</div> |
| </div> |
| </td> |
| <td> |
| <div class="bg"> |
| <div class="a">A</div> |
| <div class="b1"></div> |
| <div class="c">C</div> |
| </div> |
| </td> |
| <td> |
| <div class="bg"> |
| <div class="a">A</div> |
| <div class="b2"></div> |
| <div class="c">C</div> |
| </div> |
| </td> |
| <td> |
| <div class="bg"> |
| <div class="a">A</div> |
| <div class="b3"></div> |
| <div class="c">C</div> |
| </div> |
| </td> |
| <td> |
| <div class="bg"> |
| <div class="a">A</div> |
| <div class="b4"></div> |
| <div class="c">C</div> |
| </div> |
| </td> |
| <td> |
| <div class="bg"> |
| <div class="a">A</div> |
| <div class="b5"></div> |
| <div class="c">C</div> |
| </div> |
| </td> |
| <td> |
| <div class="bg"> |
| <div class="a">A</div> |
| <div class="b6"></div> |
| <div class="c">C</div> |
| </div> |
| </td> |
| <td> |
| <div class="bg"> |
| <div class="a">A</div> |
| <div class="b7"></div> |
| <div class="c">C</div> |
| </div> |
| </td> |
| </tr> |
| </table> |
| </body> |
| </html> |