tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

margin-collapse-040.xht (2347B)


      1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
      2 
      3 <html xmlns="http://www.w3.org/1999/xhtml">
      4 
      5  <head>
      6 
      7   <title>CSS Test: margin collapsing - clear with child margin</title>
      8 
      9   <!--
     10   Inspired by
     11   http://test.csswg.org/suites/css2.1/20110323/html4/c5525-fltmult-000.htm
     12   -->
     13 
     14   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
     15   <link rel="reviewer" title="Arron Eicholz" href="arronei(at)gmail.com" /> <!-- 2013-07-30 -->
     16   <link rel="bookmark" href="http://lists.w3.org/Archives/Public/public-css-testsuite/2012Jan/0022.html" title="[RC6] c5525-fltmult-000 imprecise and failed by several browsers" />
     17   <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#collapsing-margins" title="8.3.1 Collapsing margins" />
     18   <link rel="match" href="../reference/ref-filled-green-100px-square.xht" />
     19 
     20   <meta name="assert" content="An element on which 'clear' is set to a value other than 'none' can have its own margin-top collapse with its first inflow block-level child as long as no line boxes, no clearance, no padding and no border separate them." />
     21 
     22   <style type="text/css"><![CDATA[
     23   body {margin: 8px;}
     24 
     25   p {margin: 1em 0em;}
     26 
     27   div#overlapped-red
     28   {
     29   background-color: red;
     30   height: 100px;
     31   position: absolute;
     32   width: 100px;
     33   z-index: -1;
     34   }
     35 
     36   div#floated-left
     37   {
     38   background-color: green;
     39   color: green;
     40   float: left;
     41   font: 1em/1.25 serif;
     42   padding: 15px;
     43   /*
     44 
     45     15px : padding-top
     46   +
     47     20px : line box height
     48   +
     49     15px : padding-bottom
     50    =====
     51     50px
     52 
     53   */
     54   width: 70px;
     55   }
     56 
     57   div#cleared-left {clear: left;}
     58 
     59   table
     60   {
     61   border-collapse: separate;
     62   border-spacing: 0px;
     63   margin-top: 50px;
     64   }
     65 
     66   td
     67   {
     68   background-color: green;
     69   color: green;
     70   height: 50px;
     71   padding: 0px;
     72   width: 100px;
     73   }
     74 
     75   /*
     76   The idea is to have div#cleared-left's margin-top collapse
     77   with the table's margin-top. The margin collapsing
     78   should occur before calculating clearance.
     79   */
     80   ]]></style>
     81 
     82  </head>
     83 
     84  <body>
     85 
     86   <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
     87 
     88   <div id="overlapped-red"></div>
     89 
     90   <div id="floated-left">flt lef</div>
     91 
     92   <div id="cleared-left">
     93    <table>
     94     <tr>
     95      <td>td</td>
     96     </tr>
     97    </table>
     98   </div>
     99 
    100  </body>
    101 </html>