row-grid-lanes-alignment-positioned-items-002.html (2418B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <title>CSS Grid Lanes Test: Safe and unsafe alignment values for positioned items</title> 6 <link rel="author" title="Yanling Wang" href="mailto:yanlingwang@microsoft.com"> 7 <link rel="help" href="https://drafts.csswg.org/css-grid-3/#abspos"> 8 <link rel="help" href="https://drafts.csswg.org/css-grid-3/#alignment"> 9 <link rel="match" href="row-grid-lanes-alignment-positioned-items-002-ref.html"> 10 <style> 11 html,body { 12 color:black; background-color:white; font:8px/1 monospace; padding:0; margin:0; 13 } 14 15 .grid-lanes { 16 position: relative; 17 display: grid-lanes; 18 grid-lanes-direction: row; 19 grid-template-rows: 80px 80px 80px; 20 width: 150px; 21 height: 290px; 22 gap: 10px; 23 padding: 10px; 24 border: 2px solid black; 25 margin: 10px; 26 } 27 28 .grid-lanes > div { 29 position: absolute; 30 border: 1px solid #333; 31 width: 30px; 32 height: 120px; 33 display: flex; 34 align-items: center; 35 justify-content: center; 36 } 37 38 .safe-start { 39 grid-row: 1 / 2; 40 justify-self: safe start; 41 background: lightcoral; 42 } 43 44 .unsafe-start { 45 grid-row: 2 / 3; 46 justify-self: unsafe start; 47 background: lightblue; 48 } 49 50 .safe-end { 51 grid-row: 3 / 4; 52 justify-self: safe end; 53 background: lightgreen; 54 } 55 56 .unsafe-end { 57 grid-row: 1 / 2; 58 justify-self: unsafe end; 59 background: lightyellow; 60 } 61 62 .safe-center { 63 grid-row: 2 / 3; 64 justify-self: safe center; 65 background: plum; 66 } 67 68 .unsafe-center { 69 grid-row: 3 / 4; 70 justify-self: unsafe center; 71 background: orange; 72 } 73 </style> 74 </head> 75 <body> 76 <div class="grid-lanes"> 77 <div class="safe-start">safe-start</div> 78 <div class="unsafe-start">unsafe-start</div> 79 <div class="safe-end">safe-end</div> 80 <div class="unsafe-end">unsafe-end</div> 81 <div class="safe-center">safe-center</div> 82 <div class="unsafe-center">unsafe-center</div> 83 </div> 84 85 <div class="grid-lanes" style="direction: rtl;"> 86 <div class="safe-start">safe-start</div> 87 <div class="unsafe-start">unsafe-start</div> 88 <div class="safe-end">safe-end</div> 89 <div class="unsafe-end">unsafe-end</div> 90 <div class="safe-center">safe-center</div> 91 <div class="unsafe-center">unsafe-center</div> 92 </div> 93 </body> 94 </html>