margin-inline-001

Margin on non-replaced inline elements

WeasyPrint

This browser

Flags
ahem
Assertion
Non-replaced inline elements do not apply vertical margins.

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 on non-replaced inline elements</title>
 5         <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
 6         <link rel="help" href="http://www.w3.org/TR/CSS21/box.html#margin-properties">
 7         <meta name="flags" content="ahem">
 8         <meta name="assert" content="Non-replaced inline elements do not apply vertical margins.">
 9         <style type="text/css">
10              div
11              {
12                  background: red;
13                  border: solid green;
14                  font-family: Ahem;
15                  line-height: 1;
16                  width: 4em;
17              }
18              span
19              {
20                  background: green;
21                  color: green;
22                  margin: 2em 0;
23              }
24         </style>
25     </head>
26     <body>
27         <p>Test passes if there is a green box below and no red.</p>
28          <div>
29              <span>XXXX XXXX XXXX</span>
30          </div>
31     </body>
32 </html>