block-replaced-height-001

Block replaced elements with 'margin-top' and 'margin-bottom' as 'auto'

WeasyPrint

This browser

Flags
image
Assertion
A block replaced elements' used value of 'margin-top' and/or 'margin-bottom' set to 'auto' is '0'.

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: Block replaced elements with 'margin-top' and 'margin-bottom' as 'auto'</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height">
 7         <meta name="flags" content="image">
 8         <meta name="assert" content="A block replaced elements' used value of 'margin-top' and/or 'margin-bottom' set to 'auto' is '0'.">
 9         <style type="text/css">
10             div
11             {
12                 border-bottom: solid orange;
13                 border-top: solid orange;
14                 line-height: 0;
15                 width: 1in;
16             }
17             img
18             {
19                 display: block;
20                 margin-top: auto;
21                 margin-bottom: auto;
22             }
23         </style>
24     </head>
25     <body>
26         <p>Test passes if there is no white space between the blue box below and the orange lines.</p>
27         <div>
28             <img alt="blue 15x15" src="support/blue15x15.png">
29         </div>
30     </body>
31 </html>