flexbox-align-self-horiz-004.xhtml (2513B)
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 <!-- Testcase for align-items / align-self behavior, with all the possible 7 values included on different items within a flex container, and with the 8 flex container being shorter than its items. --> 9 <html xmlns="http://www.w3.org/1999/xhtml"> 10 <head> 11 <title>CSS Test: Testing the behavior of 'align-self' with a horizontal flex container that's shorter than its items, with margin/padding/border on the items</title> 12 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/> 13 <link rel="help" href="http://www.w3.org/TR/css-flexbox-1/#align-items-property"/> 14 <link rel="match" href="flexbox-align-self-horiz-004-ref.xhtml"/> 15 <style> 16 .flexbox { 17 border: 1px dashed blue; 18 padding: 3px; 19 height: 4px; 20 display: inline-flex; 21 font-size: 10px; 22 line-height: 10px; 23 font-family: sans-serif; 24 margin-top: 20px; 25 margin-bottom: 120px; 26 vertical-align: top; 27 } 28 29 .flexbox > div { 30 width: 40px; 31 margin: 1px 2px 3px 4px; 32 border-width: 2px 3px 4px 5px; 33 padding: 3px 4px 5px 6px; 34 border-style: dotted; 35 } 36 37 .big { 38 height: 100px; 39 font-size: 20px; 40 line-height: 20px; 41 } 42 43 /* Classes for each of the various align-self values */ 44 .flex-start { 45 background: lime; 46 align-self: flex-start; 47 } 48 .flex-end { 49 background: orange; 50 align-self: flex-end; 51 } 52 .center { 53 background: lightblue; 54 align-self: center; 55 } 56 .baseline { 57 background: teal; 58 align-self: baseline; 59 } 60 .stretch { 61 background: pink; 62 min-height: 2px; 63 align-self: stretch; 64 } 65 </style> 66 </head> 67 <body> 68 <div class="flexbox"> 69 <div class="flex-start">start</div> 70 <div class="flex-start big">a b c d e f</div> 71 <div class="flex-end">end</div> 72 <div class="flex-end big">a b c d e f</div> 73 <div class="center">center</div> 74 <div class="center big">a b c d e f</div> 75 </div> 76 <br/> 77 <div class="flexbox"> 78 <div class="baseline">base</div> 79 <div class="baseline big">abc</div> 80 <div class="stretch">stretch</div> 81 <div class="stretch big">a b c d e f</div> 82 </div> 83 </body> 84 </html>