top-044

Top using centimeters with a positive nominal value, +2.54cm

WeasyPrint

This browser

Assertion
The 'top' property sets a positive nominal length value in centimeters.

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: Top using centimeters with a positive nominal value, +2.54cm</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#propdef-top">
 7         <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#position-props">
 8         <meta name="flags" content="">
 9         <meta name="assert" content="The 'top' property sets a positive nominal length value in centimeters.">
10         <style type="text/css">
11             div
12             {
13                 position: relative;
14             }
15             #div1
16             {
17                 margin-top: -2.54cm;
18             }
19             #div2
20             {
21                 background: red;
22                 height: 2.54cm;
23                 margin-top: 2.54cm;
24                 position: absolute;
25                 top: 0;
26                 width: 100%;
27             }
28             #div3
29             {
30                 border-bottom: 2.54cm solid black;
31                 top: +2.54cm;
32             }
33         </style>
34     </head>
35     <body>
36         <p>Test passes if there is no red visible on the page.</p>
37         <div id="div1">
38             <div id="div2"></div>
39             <div id="div3"></div>
40         </div>
41     </body>
42 </html>