grid-abspos-staticpos-justify-self-img-002.html (5285B)
1 <!DOCTYPE html> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <html> 7 <head> 8 <meta charset="utf-8"> 9 <title>CSS Test: Static position of abspos replaced children in a static-pos grid container, with various "justify-self" values</title> 10 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"> 11 <link rel="help" href="https://drafts.csswg.org/css-grid/#abspos-items"> 12 <link rel="match" href="grid-abspos-staticpos-justify-self-img-002-ref.html"> 13 <style> 14 .container { 15 display: grid; 16 padding: 2px 1px; 17 border: 1px solid black; 18 background: yellow; 19 margin-bottom: 5px; 20 margin-right: 9px; 21 float: left; /* For testing in "rows" of containers */ 22 } 23 br { clear: both } 24 25 .big > .container { 26 width: 40px; 27 height: 22px; 28 grid: 3px 14px 3px / 2px 30px 2px; 29 } 30 .small > .container { 31 grid: 3px 2px 3px / 0px 2px 0px; 32 width: 2px; 33 height: 4px; 34 margin-bottom: 20px; /* to reduce overlap between overflowing images */ 35 } 36 37 .container > * { 38 position: absolute; 39 grid-area: 2 / 2 / 3 / 3; 40 } 41 </style> 42 </head> 43 <body> 44 <div class="big"> 45 <!-- The various justify-self values, from 46 https://www.w3.org/TR/css-align-3/#propdef-justify-self --> 47 <!-- auto | normal | stretch --> 48 <div class="container"><img src="support/colors-8x16.png" 49 style="justify-self: auto"></div> 50 <div class="container"><img src="support/colors-8x16.png" 51 style="justify-self: normal"></div> 52 <div class="container"><img src="support/colors-8x16.png" 53 style="justify-self: stretch"></div> 54 <br> 55 <!-- <baseline-position> --> 56 <div class="container"><img src="support/colors-8x16.png" 57 style="justify-self: baseline"></div> 58 <br> 59 <!-- <self-position>, part 1 --> 60 <div class="container"><img src="support/colors-8x16.png" 61 style="justify-self: center"></div> 62 <div class="container"><img src="support/colors-8x16.png" 63 style="justify-self: start"></div> 64 <div class="container"><img src="support/colors-8x16.png" 65 style="justify-self: end"></div> 66 <div class="container"><img src="support/colors-8x16.png" 67 style="justify-self: self-start"></div> 68 <div class="container"><img src="support/colors-8x16.png" 69 style="justify-self: self-end"></div> 70 <br> 71 <!-- <self-position>, part 2 --> 72 <div class="container"><img src="support/colors-8x16.png" 73 style="justify-self: flex-start"></div> 74 <div class="container"><img src="support/colors-8x16.png" 75 style="justify-self: flex-end"></div> 76 <div class="container"><img src="support/colors-8x16.png" 77 style="justify-self: left"></div> 78 <div class="container"><img src="support/colors-8x16.png" 79 style="justify-self: right"></div> 80 <br> 81 </div> 82 <div class="small"> 83 <!-- The various justify-self values, from 84 https://www.w3.org/TR/css-align-3/#propdef-justify-self --> 85 <!-- auto | normal | stretch --> 86 <div class="container"><img src="support/colors-8x16.png" 87 style="justify-self: auto"></div> 88 <div class="container"><img src="support/colors-8x16.png" 89 style="justify-self: normal"></div> 90 <div class="container"><img src="support/colors-8x16.png" 91 style="justify-self: stretch"></div> 92 <br> 93 <!-- <baseline-position> --> 94 <div class="container"><img src="support/colors-8x16.png" 95 style="justify-self: baseline"></div> 96 <br> 97 <!-- <self-position>, part 1 --> 98 <div class="container"><img src="support/colors-8x16.png" 99 style="justify-self: center"></div> 100 <div class="container"><img src="support/colors-8x16.png" 101 style="justify-self: start"></div> 102 <div class="container"><img src="support/colors-8x16.png" 103 style="justify-self: end"></div> 104 <div class="container"><img src="support/colors-8x16.png" 105 style="justify-self: self-start"></div> 106 <div class="container"><img src="support/colors-8x16.png" 107 style="justify-self: self-end"></div> 108 <br> 109 <!-- <self-position>, part 2 --> 110 <div class="container"><img src="support/colors-8x16.png" 111 style="justify-self: flex-start"></div> 112 <div class="container"><img src="support/colors-8x16.png" 113 style="justify-self: flex-end"></div> 114 <div class="container"><img src="support/colors-8x16.png" 115 style="justify-self: left"></div> 116 <div class="container"><img src="support/colors-8x16.png" 117 style="justify-self: right"></div> 118 <br> 119 </div> 120 </body> 121 </html>