grid-order-property-auto-placement-003.html (1525B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: 'order' property affects grid items auto-placement position</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 #grid { 20 display: grid; 21 font: 50px/1 Ahem; 22 grid-template-columns: auto auto; 23 justify-content: start; 24 align-content: start; 25 } 26 27 #blue { 28 color: blue; 29 order: -5; 30 } 31 32 #yellow { 33 color: yellow; 34 order: -5; 35 } 36 37 #lime { 38 color: lime; 39 } 40 41 #magenta { 42 color: magenta; 43 order: 1; 44 } 45 </style> 46 <p>Test passes if there are four filled squares with the same size and <strong>no red</strong>.</p> 47 <p>Blue and yellow squares in the first line; lime and magenta squares in the second line (exactly in this order).</p> 48 49 <div id="reference-overlapped-red"></div> 50 <div id="grid"> 51 <div id="lime">L</div> 52 <div id="magenta">M</div> 53 <div id="blue">B</div> 54 <div id="yellow">Y</div> 55 </div>