OLD | NEW |
(Empty) | |
| 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: 4px; |
| 18 float: left; |
| 19 direction: rtl; |
| 20 font-family: sans-serif; |
| 21 font-size: 10px; |
| 22 margin-left: 80px; |
| 23 } |
| 24 |
| 25 .flex-start, .flex-end, .center, .baseline, .stretch { |
| 26 clear: both; |
| 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 div.big { |
| 34 font-size: 18px; |
| 35 width: 50px; |
| 36 } |
| 37 |
| 38 /* Classes for each of the various align-self values */ |
| 39 .flex-start { |
| 40 background: lime; |
| 41 float: right; |
| 42 } |
| 43 .flex-end { |
| 44 background: orange; |
| 45 float: left; |
| 46 } |
| 47 <!-- We center shrinkwrapped text by putting it into an inline-block, and |
| 48 then wrapping that inline-block in a helper-div that has |
| 49 "text-align:center" set. For this to work, the parent has to be at |
| 50 least as wide as the centered content inside of it, so we make it |
| 51 large with a negative margin such that its center aligns with the |
| 52 4px-wide container's center. --> |
| 53 .centerParent { |
| 54 text-align: center; |
| 55 width: 100px; |
| 56 margin-right: -48px; |
| 57 } |
| 58 .center { |
| 59 background: lightblue; |
| 60 display: inline-block; |
| 61 text-align: right; /* Keep parent's centering from tweaking my text */ |
| 62 } |
| 63 .baseline { |
| 64 background: teal; |
| 65 float: right; |
| 66 } |
| 67 .stretch { |
| 68 background: pink; |
| 69 } |
| 70 .clearFloats { clear: both } |
| 71 </style> |
| 72 </head> |
| 73 <body> |
| 74 <div class="flexbox"> |
| 75 <div class="flex-start">start</div> |
| 76 <div class="flex-start big">a b</div> |
| 77 <div class="clearFloats"></div> |
| 78 <div class="stretch">stretch</div> |
| 79 <!-- Force a 3px + 1px = 4px margin between this and the previous div |
| 80 (to thwart the effects of margin-collapsing). This is the only |
| 81 place we need this hack, because everywhere else in this test |
| 82 we use floats or inline-blocks, whose margins don't collapse. --> |
| 83 <div class="stretch big" style="margin-top: 4px">a b</div> |
| 84 <div class="centerParent"> |
| 85 <div class="center">center</div> |
| 86 </div> |
| 87 <div class="centerParent"> |
| 88 <div class="center big">a b</div> |
| 89 </div> |
| 90 </div> |
| 91 <div class="flexbox"> |
| 92 <div class="baseline">base</div> |
| 93 <div class="baseline big">abc</div> |
| 94 <div class="flex-end">end</div> |
| 95 <div class="flex-end big">a b</div> |
| 96 </div> |
| 97 </body> |
| 98 </html> |
OLD | NEW |