grid-abspos-staticpos-align-self-last-baseline-002.html (1617B)
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 children in a static-pos grid container, with various "align-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-align-self-last-baseline-002-ref.html"> 13 <style> 14 .container { 15 display: grid; 16 padding: 1px 2px; 17 border: 1px solid black; 18 background: yellow; 19 margin-bottom: 5px; 20 margin-right: 5px; 21 float: left; /* For testing in "rows" of containers */ 22 align-items: center; /* To exercise 'align-self: auto' on children */ 23 } 24 br { clear: both } 25 26 .big > .container { 27 height: 30px; 28 width: 22px; 29 grid: 2px 20px 2px / 3px 14px 3px; 30 } 31 .small > .container { 32 grid: 0px 2px 0px / 3px 2px 3px; 33 height: 2px; 34 width: 4px; 35 } 36 37 .container > * { 38 position: absolute; 39 grid-area: 2 / 2 / 3 / 3; 40 background: teal; 41 height: 6px; 42 width: 8px; 43 } 44 </style> 45 </head> 46 <body> 47 <!-- The last baseline value, from 48 https://www.w3.org/TR/css-align-3/#propdef-align-self --> 49 <div class="big"> 50 <div class="container"><div style="align-self: last baseline"></div></div> 51 </div> 52 <div class="small"> 53 <div class="container"><div style="align-self: last baseline"></div></div> 54 </div> 55 </body> 56 </html>