svillar@igalia.com | ff2f7a8 | 2021-02-10 11:29:13 +0000 | [diff] [blame^] | 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 floated divs |
| 7 | in place of flex items and using margin-top in place of the align-items / |
| 8 | 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="Daniel Holbert" href="mailto:dholbert@mozilla.com"/> |
| 13 | <style> |
| 14 | .flexbox { |
| 15 | border: 1px dashed blue; |
| 16 | height: 200px; |
| 17 | width: 560px; |
| 18 | font-size: 10px; |
| 19 | line-height: 10px; |
| 20 | } |
| 21 | |
| 22 | .flexbox > div { |
| 23 | width: 40px; |
| 24 | float: left; |
| 25 | } |
| 26 | |
| 27 | .big { |
| 28 | height: 100px; |
| 29 | font-size: 20px; |
| 30 | line-height: 20px; |
| 31 | } |
| 32 | |
| 33 | /* Classes for each of the various align-self values */ |
| 34 | .flex-start { |
| 35 | background: lime; |
| 36 | } |
| 37 | .flex-end { |
| 38 | background: orange; |
| 39 | } |
| 40 | .center { |
| 41 | background: lightblue; |
| 42 | } |
| 43 | .baseline { |
| 44 | background: teal; |
| 45 | } |
| 46 | .stretch { |
| 47 | background: pink; |
| 48 | } |
| 49 | .auto { |
| 50 | background: yellow; |
| 51 | } |
| 52 | .unspecified { |
| 53 | background: lightgreen; |
| 54 | } |
| 55 | .initial { |
| 56 | background: aqua; |
| 57 | } |
| 58 | .inherit { |
| 59 | background: violet; |
| 60 | } |
| 61 | </style> |
| 62 | </head> |
| 63 | <body> |
| 64 | <div class="flexbox"> |
| 65 | <div class="flex-start">start</div> |
| 66 | <div class="flex-start big">a b c d e f</div> |
| 67 | <div class="flex-end" style="margin-top: 190px">end</div> |
| 68 | <div class="flex-end big" style="margin-top: 100px">a b c d e f</div> |
| 69 | <div class="center" style="margin-top: 95px">center</div> |
| 70 | <div class="center big" style="margin-top: 50px">a b c d e f</div> |
| 71 | <!-- We use inline-blocks inside of a wrapper-block as references for the |
| 72 | baseline-aligned flex items, since inline-blocks get |
| 73 | baseline-aligned in block layout. We also need to specify the widths |
| 74 | manually here since the "flexbox > div" child-selector doesn't |
| 75 | handle these guys (since they're grandchildren). |
| 76 | --> |
| 77 | <div style="width: 80px"> |
| 78 | <div class="baseline" |
| 79 | style="width: 40px; display: inline-block">base</div |
| 80 | ><div class="baseline big" |
| 81 | style="width: 40px; display: inline-block">abc</div> |
| 82 | </div> |
| 83 | <div class="stretch" style="height: 100%">stretch</div> |
| 84 | <div class="stretch big">a b c d e f</div> |
| 85 | <div class="auto" style="margin-top: 95px">auto</div> |
| 86 | <div class="unspecified" style="margin-top: 95px">unspec</div> |
| 87 | <div class="initial" style="margin-top: 95px">initial</div> |
| 88 | <div class="inherit" style="margin-top: 190px">inherit</div> |
| 89 | </div> |
| 90 | </body> |
| 91 | </html> |