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