grid-inline-order-property-auto-placement-002.html (1516B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: 'order' property affects grid items auto-placement position within an inline grid</title> 4 <link rel="author" title="Manuel Rego Casasnovas" href="mailto:rego@igalia.com"> 5 <link rel="help" href="http://www.w3.org/TR/css-grid-1/#order-property" title="4.2 Reordered Grid Items: the order property"> 6 <link rel="help" href="https://drafts.csswg.org/css-flexbox-1/#order-property" title="5.4. Display Order: the order property"> 7 <link rel="match" href="../reference/grid-2x2-blue-yellow-lime-magenta.html"> 8 <meta name="flags" content="ahem"> 9 <link rel="stylesheet" type="text/css" href="/fonts/ahem.css" /> 10 <style> 11 #reference-overlapped-red { 12 position: absolute; 13 background-color: red; 14 width: 100px; 15 height: 100px; 16 z-index: -1; 17 } 18 19 #inline-grid { 20 display: inline-grid; 21 font: 50px/1 Ahem; 22 grid-template-columns: auto auto; 23 } 24 25 #blue { 26 color: blue; 27 order: -10; 28 } 29 30 #yellow { 31 color: yellow; 32 order: -5; 33 } 34 35 #lime { 36 color: lime; 37 order: -1; 38 } 39 40 #magenta { 41 color: magenta; 42 } 43 </style> 44 <p>Test passes if there are four filled squares with the same size and <strong>no red</strong>.</p> 45 <p>Blue and yellow squares in the first line; lime and magenta squares in the second line (exactly in this order).</p> 46 47 <div id="reference-overlapped-red"></div> 48 <div id="inline-grid"> 49 <div id="magenta">M</div> 50 <div id="lime">L</div> 51 <div id="yellow">Y</div> 52 <div id="blue">B</div> 53 </div>