|
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 <!-- Testcase for align-items / align-self behavior with auto margins in |
|
7 play (which should negate the effects of align-items / align-self, |
|
8 because there won't be any available space in which to align the item |
|
9 after the auto margins are resolved). --> |
|
10 <html xmlns="http://www.w3.org/1999/xhtml"> |
|
11 <head> |
|
12 <title>CSS Test: Testing the behavior of 'align-self' with auto margins in play, in a horizontal flex container</title> |
|
13 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/> |
|
14 <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#auto-margins"/> |
|
15 <link rel="match" href="flexbox-align-self-horiz-5-ref.xhtml"/> |
|
16 <style> |
|
17 .flexbox { |
|
18 border: 1px dashed blue; |
|
19 height: 140px; |
|
20 width: 400px; |
|
21 display: flex; |
|
22 font-size: 10px; |
|
23 line-height: 10px; |
|
24 margin-bottom: 10px; |
|
25 } |
|
26 |
|
27 .kidsAutoTop > div { margin-top: auto; } |
|
28 .kidsAutoBottom > div { margin-bottom: auto; } |
|
29 .kidsAutoBoth > div { margin: auto 0; } |
|
30 |
|
31 .flexbox > div { |
|
32 width: 40px; |
|
33 } |
|
34 |
|
35 .flexbox > div.big { |
|
36 height: 80px; |
|
37 font-size: 20px; |
|
38 line-height: 20px; |
|
39 } |
|
40 |
|
41 /* Classes for each of the various align-self values */ |
|
42 .flex-start { |
|
43 background: lime; |
|
44 align-self: flex-start; |
|
45 } |
|
46 .flex-end { |
|
47 background: orange; |
|
48 align-self: flex-end; |
|
49 } |
|
50 .center { |
|
51 background: lightblue; |
|
52 align-self: center; |
|
53 } |
|
54 .baseline { |
|
55 background: teal; |
|
56 align-self: baseline; |
|
57 } |
|
58 .stretch { |
|
59 background: pink; |
|
60 align-self: stretch; |
|
61 } |
|
62 </style> |
|
63 </head> |
|
64 <body> |
|
65 <div class="flexbox kidsAutoTop"> |
|
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="center">center</div> |
|
71 <div class="center big">a b c d e f</div> |
|
72 <div class="baseline">base</div> |
|
73 <div class="baseline big">a b c d e f</div> |
|
74 <div class="stretch">stretch</div> |
|
75 <div class="stretch big">a b c d e f</div> |
|
76 </div> |
|
77 |
|
78 <div class="flexbox kidsAutoBottom"> |
|
79 <div class="flex-start">start</div> |
|
80 <div class="flex-start big">a b c d e f</div> |
|
81 <div class="flex-end">end</div> |
|
82 <div class="flex-end big">a b c d e f</div> |
|
83 <div class="center">center</div> |
|
84 <div class="center big">a b c d e f</div> |
|
85 <div class="baseline">base</div> |
|
86 <div class="baseline big">a b c d e f</div> |
|
87 <div class="stretch">stretch</div> |
|
88 <div class="stretch big">a b c d e f</div> |
|
89 </div> |
|
90 |
|
91 <div class="flexbox kidsAutoBoth"> |
|
92 <div class="flex-start">start</div> |
|
93 <div class="flex-start big">a b c d e f</div> |
|
94 <div class="flex-end">end</div> |
|
95 <div class="flex-end big">a b c d e f</div> |
|
96 <div class="center">center</div> |
|
97 <div class="center big">a b c d e f</div> |
|
98 <div class="baseline">base</div> |
|
99 <div class="baseline big">a b c d e f</div> |
|
100 <div class="stretch">stretch</div> |
|
101 <div class="stretch big">a b c d e f</div> |
|
102 </div> |
|
103 </body> |
|
104 </html> |