grid-first-line-003

'::first-line' works on grid items

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Assertion
This test checks that '::first-line' pseudo-element works as expected if it is applied directly to a grid item.

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 Grid Layout Test: '::first-line' works on grid items</title>
 5         <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com">
 6         <link rel="help" href="http://www.w3.org/TR/css-grid-1/#grid-containers" title="3.1 Establishing Grid Containers">
 7         <link rel="help" href="http://www.w3.org/TR/css3-selectors/#first-formatted-line" title="7.1.1. First formatted line definition in CSS">
 8         <link rel="match" href="reference/grid-text-green-margin-no-collapse-ref.htm">
 9         <meta name="assert" content="This test checks that '::first-line' pseudo-element works as expected if it is applied directly to a grid item.">
10         <style type="text/css">
11             .grid {
12                 display: grid;
13                 color: red;
14             }
15 
16             .item::first-line {
17                 color: green;
18             }
19         </style>
20     </head>
21     <body>
22         <div class="grid">
23             <div class="item">
24                 <p>This text should be <strong>green</strong> and body and paragraph margins should <strong>not collapse</strong>.</p>
25             </div>
26         </div>
27     </body>
28 </html>