c5501-mrgn-t-000

margin-top

WeasyPrint

This browser

Flags
ahem

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: margin-top</title>
 5   <meta name="flags" content="ahem">
 6   <link rel="help" href="http://www.w3.org/TR/REC-CSS1#margin-top">
 7   <link rel="author" title="CSS1 Test Suite Contributors" href="http://www.w3.org/Style/CSS/Test/CSS1/current/tsack.html">
 8   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 9   <style type="text/css">
10    .test { font: 10px/1 Ahem; width: 10em; border: solid black; padding: 0; background: yellow; color: orange; }
11    .zero {background-color: teal; margin-top: 0;}
12    .one {margin-top: 5.29166mm; background-color: aqua;}
13    .two {margin-top: 20px; background-color: blue;}
14    .three {margin-top: 2em; background-color: aqua;}
15    .four {margin-top: 20%; background-color: teal;}
16    .five {margin-top: 20px;}
17    .six {margin-top: -10px; background-color: aqua;}
18    p, ul, li {margin: 0; padding: 0; list-style:none;}
19 
20    .control { border: solid black; padding: 0; background: red; }
21    .control .teal { background: teal; }
22    .control .aqua { background: aqua; }
23    .control .blue { background: blue; }
24    .control .yellow { background: yellow; }
25    .control .long { width: 70px; height: 10px; background: orange; }
26    .control .short { width: 40px; height: 10px; background: orange; }
27    .control .blank { width: 100px; height: 20px; }
28   </style>
29   <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#margin-properties" title="8.3 Margin properties: 'margin-top',  'margin-right',  'margin-bottom', 'margin-left', and 'margin'">
30  </head>
31  <body>
32   <p>The two diagrams below should be identical, with no red present.</p>
33   <table>
34    <tr>
35     <td class="test">
36      <p class="zero">
37       xxxxxxx
38      </p>
39      <p class="zero">
40       xxxx
41      </p>
42      <p class="one">
43       xxxxxxx xxxx
44      </p>
45      <p class="two">
46       xxxxxxx xxxx
47      </p>
48      <p class="three">
49       xxxxxxx xxxx
50      </p>
51      <p class="four">
52       xxxxxxx xxxx
53      </p>
54      <ul class="two">
55       <li>xxxxxxx</li>
56       <li>xxxx</li>
57       <li class="five">xxxxxxx</li>
58       <li>xxxx</li>
59      </ul>
60      <p class="zero">
61       xxxxxxx
62      </p>
63      <p class="six">
64       xxxxxxx xxxx
65      </p>
66     </td>
67     <td class="control">
68      <div class="teal"><div class="long"></div><div class="short"></div></div>
69      <div class="yellow"><div class="blank"></div></div>
70      <div class="aqua"><div class="long"></div><div class="short"></div></div>
71      <div class="yellow"><div class="blank"></div></div>
72      <div class="blue"><div class="long"></div><div class="short"></div></div>
73      <div class="yellow"><div class="blank"></div></div>
74      <div class="aqua"><div class="long"></div><div class="short"></div></div>
75      <div class="yellow"><div class="blank"></div></div>
76      <div class="teal"><div class="long"></div><div class="short"></div></div>
77      <div class="yellow"><div class="blank"></div></div>
78      <div class="blue"><div class="long"></div><div class="short"></div></div>
79      <div class="blue"><div class="blank"></div></div>
80      <div class="blue"><div class="long"></div><div class="short"></div></div>
81      <div class="aqua"><div class="long"></div><div class="short"></div></div>
82     </td>
83    </tr>
84   </table>
85  </body>
86 </html>