before-content-display-015

:before generated content - display table-caption

WeasyPrint

This browser

Assertion
Generated content can have their own display value explicitly set in which case they behave as if they were real elements inserted just inside their associated element.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3 
 4  <head>
 5 
 6   <title>CSS Test: :before generated content - display table-caption</title>
 7 
 8   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
 9   <link rel="help" href="http://www.w3.org/TR/CSS21/generate.html#before-after-content">
10   <link rel="help" href="http://www.w3.org/TR/CSS21/visuren.html#display-prop">
11   <meta content="" name="flags">
12   <meta content="Generated content can have their own display value explicitly set in which case they behave as if they were real elements inserted just inside their associated element." name="assert">
13 
14   <style type="text/css">
15   div:before
16   {
17   content: "Filler\A0text";  
18   /* Without a table box, the table-caption may shrink to minimum content 
19   width (MCW), thus the no-breaking-space (in utf-8) addition between 
20   "Filler" and "text" to avoid line-wrapping causing 2 lines. */
21   display: table-caption;
22   }
23   </style>
24 
25  </head>
26 
27  <body>
28 
29   <p>Test passes if there are <strong>2 lines of "Filler text"</strong>.</p>
30 
31   <div>Filler text</div>
32 
33  </body>
34 </html>