grid-items-contribution-negative-margins.html (821B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Grid Layout Test: Grid items contribution with negative margin</title> 4 <link rel="help" href="http://www.w3.org/TR/css-grid-1/#grid-items" title="4 Grid Items"> 5 <meta name="assert" content="This test checks that grid items are properly placed with negative margin."> 6 <link rel="match" href="../../reference/ref-filled-green-100px-square.xht"> 7 <style> 8 #grid { 9 background: red; 10 display: grid; 11 grid-auto-flow: column; 12 width: 100px; 13 height: 100px; 14 overflow: hidden; 15 } 16 17 #grid > div { 18 width: 100px; 19 height: 100px; 20 } 21 </style> 22 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p> 23 24 <div id="grid"> 25 <div style="background: blue; margin-left: -100px;"></div> 26 <div style="background: green;"></div> 27 </div>