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