flexbox-align-self-vert-rtl-005-ref.xhtml (3349B)
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 blocks in 7 place of flex items and using float and width keywords to emulate 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="Mihir Iyer" href="mailto:miyer@mozilla.com"/> 13 <style> 14 .flexbox { 15 border: 1px dashed blue; 16 width: 200px; 17 float: left; 18 font-size: 10px; 19 direction: rtl; 20 } 21 22 .flex-start, .flex-end, .center, .baseline, .stretch, .self-start, .self-end { 23 clear: both; 24 margin: 1px 2px 3px 4px; 25 border-width: 2px 3px 4px 5px; 26 padding: 3px 4px 5px 6px; 27 border-style: dotted; 28 } 29 30 div.big { 31 font-size: 20px; 32 width: 50px; 33 } 34 35 /* Classes for each of the various align-self values */ 36 .flex-start { 37 background: lime; 38 float: right; 39 } 40 .flex-end { 41 background: orange; 42 float: left; 43 } 44 <!-- We center shrinkwrapped text by putting it into an inline-block, and 45 then wrapping that inline-block in a helper-div that has 46 "text-align:center" set. --> 47 .centerParent { 48 text-align: center; 49 } 50 .center { 51 background: lightblue; 52 display: inline-block; 53 text-align: right; /* Keep parent's centering from tweaking my text */ 54 } 55 .baselineParent { 56 float: right; 57 } 58 .baseline { 59 background: teal; 60 float: left; 61 } 62 .stretch { 63 background: pink; 64 } 65 .self-start { 66 background: yellow; 67 float: right; 68 } 69 .self-end { 70 background: purple; 71 float: left; 72 } 73 .clearFloats { clear: both } 74 </style> 75 </head> 76 <body> 77 <div class="flexbox"> 78 <div class="flex-start">start</div> 79 <div class="flex-start big">a b c d e f</div> 80 <div class="flex-end">end</div> 81 <div class="flex-end big">a b c d e f</div> 82 <div class="clearFloats"></div> 83 <div class="centerParent"> 84 <div class="center">center</div> 85 </div> 86 <div class="centerParent"> 87 <div class="center big">a b c d e f</div> 88 </div> 89 </div> 90 <div class="flexbox"> 91 <div class="baselineParent"> 92 <div class="baseline">base</div> 93 <div class="baseline big">abc</div> 94 </div> 95 <div class="clearFloats"></div> 96 <div class="stretch">stretch</div> 97 <!-- Force a 3px + 1px = 4px margin between this and the previous div 98 (to thwart the effects of margin-collapsing). This is the only 99 place we need this hack, because everywhere else in this test 100 we use floats or inline-blocks, whose margins don't collapse. --> 101 <div class="stretch big" style="margin-top: 4px">a b c d e f</div> 102 </div> 103 <div class="flexbox"> 104 <div class="self-start">self-start</div> 105 <div class="self-start big">a b c d e f</div> 106 <div class="self-end">self-end</div> 107 <div class="self-end big">a b c d e f</div> 108 </div> 109 </body> 110 </html>