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