flexbox-align-self-horiz-003-ref.xhtml (3054B)
1 <?xml version="1.0" encoding="UTF-8"?> 2 <!-- 3 Any copyright is dedicated to the Public Domain. 4 http://creativecommons.org/publicdomain/zero/1.0/ 5 --> 6 <!-- Reference case for align-items / align-self behavior, using floated divs 7 in place of flex items and using relative positioning in place of the 8 align-items / align-self properties. --> 9 <html xmlns="http://www.w3.org/1999/xhtml"> 10 <head> 11 <title>CSS Reftest Reference</title> 12 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/> 13 <style> 14 .flexbox { 15 border: 1px dashed blue; 16 padding: 3px; 17 width: 600px; 18 height: 4px; 19 font-size: 10px; 20 line-height: 10px; 21 font-family: sans-serif; 22 } 23 24 .flexbox > div { 25 width: 40px; 26 float: left; 27 } 28 29 .big { 30 height: 100px; 31 font-size: 20px; 32 line-height: 20px; 33 } 34 35 /* Classes for each of the various align-self values */ 36 .flex-start { 37 background: lime; 38 } 39 .flex-end { 40 background: orange; 41 } 42 .center { 43 background: lightblue; 44 } 45 .baseline { 46 background: teal; 47 } 48 .stretch { 49 background: pink; 50 } 51 .auto { 52 background: yellow; 53 } 54 .unspecified { 55 background: lightgreen; 56 } 57 .initial { 58 background: aqua; 59 } 60 .inherit { 61 background: violet; 62 } 63 .normal { 64 background: tan; 65 } 66 </style> 67 </head> 68 <body> 69 <div class="flexbox"> 70 <div class="flex-start">start</div> 71 <div class="flex-start big">a b c d e f</div> 72 <div class="flex-end" style="position: relative; top: -6px">end</div> 73 <div class="flex-end big" style="position: relative; top: -96px">a b c d e f</div> 74 <div class="center" style="position: relative; top: -3px">center</div> 75 <div class="center big" style="position: relative; top: -48px">a b c d e f</div> 76 <!-- We use inline-blocks inside of a wrapper-block as references for the 77 baseline-aligned flex items, since inline-blocks get 78 baseline-aligned in block layout. We also need to specify the widths 79 manually here since the "flexbox > div" child-selector doesn't 80 handle these guys (since they're grandchildren). 81 --> 82 <div style="width: 80px"> 83 <div class="baseline" 84 style="width: 40px; display: inline-block">base</div 85 ><div class="baseline big" 86 style="width: 40px; display: inline-block">abc</div> 87 </div> 88 <div class="stretch" style="height: 100%">stretch</div> 89 <div class="stretch big">a b c d e f</div> 90 <div class="auto" style="height: 100%">auto</div> 91 <div class="unspecified" style="height: 100%">unspec</div> 92 <div class="initial" style="height: 100%">initial</div> 93 <div class="inherit" style="height: 100%">inherit</div> 94 <div class="normal" style="height: 100%">normal</div> 95 </div> 96 </body> 97 </html>