flexbox-align-self-horiz-002.xhtml (2860B)
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 8 margin/border/padding values on each item. --> 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, 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-002-ref.xhtml"/> 15 <style> 16 .flexbox { 17 border: 1px dashed blue; 18 height: 200px; 19 display: inline-flex; 20 font-size: 10px; 21 line-height: 10px; 22 vertical-align: top; 23 } 24 25 .flexbox > div { 26 width: 40px; 27 margin: 1px 2px 3px 4px; 28 border-width: 2px 3px 4px 5px; 29 padding: 3px 4px 5px 6px; 30 border-style: dotted; 31 } 32 33 .big { 34 height: 100px; 35 font-size: 20px; 36 line-height: 20px; 37 } 38 39 /* Classes for each of the various align-self values */ 40 .flex-start { 41 background: lime; 42 align-self: flex-start; 43 } 44 .flex-end { 45 background: orange; 46 align-self: flex-end; 47 } 48 .center { 49 background: lightblue; 50 align-self: center; 51 } 52 .baseline { 53 background: teal; 54 align-self: baseline; 55 } 56 .stretch { 57 background: pink; 58 align-self: stretch; 59 } 60 .self-start { 61 background: yellow; 62 align-self: self-start; 63 } 64 .self-end { 65 background: purple; 66 align-self: self-end; 67 } 68 .wmvertrev { 69 writing-mode: vertical-lr; 70 direction: rtl; 71 } 72 </style> 73 </head> 74 <body> 75 <div class="flexbox"> 76 <div class="flex-start">start</div> 77 <div class="flex-start big">a b c d e f</div> 78 <div class="flex-end">end</div> 79 <div class="flex-end big">a b c d e f</div> 80 <div class="center">center</div> 81 <div class="center big">a b c d e f</div> 82 </div> 83 <br/> 84 <div class="flexbox"> 85 <div class="baseline">base</div> 86 <div class="baseline big">abc</div> 87 <div class="stretch">stretch</div> 88 <div class="stretch big">a b c d e f</div> 89 </div> 90 <br/> 91 <div class="flexbox"> 92 <div class="self-start">self-start</div> 93 <div class="self-start big">a b c d e f</div> 94 <div class="self-end wmvertrev">self-end</div> 95 <div class="self-end wmvertrev big">a b c d e f</div> 96 </div> 97 </body> 98 </html>