grid-inline.html (918B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>margin-trim: grid-inline</title> 5 <link rel="author" title="Sammy Gill" href="mailto:sammy.gill@apple.com"> 6 <link rel="help" href="https://drafts.csswg.org/css-box-4/#margin-trim-grid"> 7 <link rel="match" href="/css/reference/ref-filled-green-100px-square-only.html"> 8 <meta name="assert" content="inline should trim inline-start margin of items on first column and inline-end margins of items on last column"> 9 <style> 10 grid { 11 display: inline-grid; 12 grid-template-columns: auto auto; 13 margin-trim: inline; 14 } 15 item { 16 display: block; 17 background-color: green; 18 width: 50px; 19 height: 50px; 20 } 21 item:nth-child(odd) { 22 margin-inline-start: 10px; 23 } 24 item:nth-child(even) { 25 margin-inline-end: 20px; 26 } 27 </style> 28 </head> 29 <body> 30 <p>Test passes if there is a filled green square.</p> 31 <grid> 32 <item></item> 33 <item></item> 34 <item></item> 35 <item></item> 36 </grid> 37 </body> 38 </html>