10 background-color: #aaa;
19 .flexbox :nth-child(
1) {
20 background-color: blue;
22 .flexbox :nth-child(
2) {
23 background-color: green;
25 .flexbox :nth-child(
3) {
26 background-color: red;
29 <script src=
"../../resources/check-layout.js"></script>
30 <body onload=
"checkLayout('.flexbox')">
32 <div data-expected-width=
"100" data-offset-x=
"0" style=
"flex: 1 0 0; max-width: 100px;"></div>
33 <div data-expected-width=
"100" data-offset-x=
"100" style=
"width: 100px;"></div>
34 <div data-expected-width=
"100" data-offset-x=
"200" style=
"width: 100px;"></div>
37 <div class=
"flexbox" style=
"justify-content: flex-end">
38 <div data-expected-width=
"100" data-offset-x=
"300" style=
"flex: 0 0 100px;"></div>
39 <div data-expected-width=
"100" data-offset-x=
"400" style=
"width: 100px;"></div>
40 <div data-expected-width=
"100" data-offset-x=
"500" style=
"width: 100px;"></div>
43 <div class=
"flexbox" style=
"justify-content: center">
44 <div data-expected-width=
"100" data-offset-x=
"150" style=
"flex: 1 0 0; max-width: 100px;"></div>
45 <div data-expected-width=
"100" data-offset-x=
"250" style=
"width: 100px;"></div>
46 <div data-expected-width=
"100" data-offset-x=
"350" style=
"width: 100px;"></div>
49 <div class=
"flexbox" style=
"justify-content: center">
50 <div data-expected-width=
"200" data-offset-x=
"0" style=
"flex: 1 100px;"></div>
51 <div data-expected-width=
"200" data-offset-x=
"200" style=
"flex: 1 100px;"></div>
52 <div data-expected-width=
"200" data-offset-x=
"400" style=
"flex: 1 100px;"></div>
55 <!-- True centering on overflow. -->
56 <div class=
"flexbox" style=
"justify-content: center">
57 <div data-expected-width=
"800" data-offset-x=
"-100" style=
"width: 800px;"></div>
60 <div class=
"flexbox" style=
"justify-content: space-between">
61 <div data-expected-width=
"100" data-offset-x=
"0" style=
"flex: 1 0 0; max-width: 100px;"></div>
62 <div data-expected-width=
"100" data-offset-x=
"250" style=
"width: 100px;"></div>
63 <div data-expected-width=
"100" data-offset-x=
"500" style=
"width: 100px;"></div>
66 <div class=
"flexbox" style=
"justify-content: space-between">
67 <div data-expected-width=
"200" data-offset-x=
"0" style=
"flex: 1 100px;"></div>
68 <div data-expected-width=
"200" data-offset-x=
"200" style=
"flex: 1 100px;"></div>
69 <div data-expected-width=
"200" data-offset-x=
"400" style=
"flex: 1 100px;"></div>
72 <!-- If there's only one child, we justify-content: flex-start. -->
73 <div class=
"flexbox" style=
"justify-content: space-between">
74 <div data-expected-width=
"100" data-offset-x=
"0" style=
"flex: 1 0 0; max-width: 100px;"></div>
77 <div class=
"flexbox" style=
"justify-content: space-around">
78 <div data-expected-width=
"100" data-offset-x=
"50" style=
"flex: 1 0 0; max-width: 100px;"></div>
79 <div data-expected-width=
"100" data-offset-x=
"250" style=
"width: 100px;"></div>
80 <div data-expected-width=
"100" data-offset-x=
"450" style=
"width: 100px;"></div>
83 <!-- If there's only one child, we justify-content center. -->
84 <div class=
"flexbox" style=
"justify-content: space-around">
85 <div data-expected-width=
"100" data-offset-x=
"250" style=
"flex: 1 0 0; max-width: 100px;"></div>
88 <!-- True centering on overflow. -->
89 <div class=
"flexbox" style=
"justify-content: space-around">
90 <div data-expected-width=
"800" data-offset-x=
"-100" style=
"width: 800px;"></div>
93 <!-- Make sure we don't crash with no children. -->
94 <div class=
"flexbox" style=
"justify-content: space-around"></div>
96 <!-- margin:auto applies before justify-content. -->
97 <div class=
"flexbox" style=
"justify-content: flex-end">
98 <div data-expected-width=
"100" data-offset-x=
"0" style=
"width: 100px;"></div>
99 <div data-expected-width=
"100" data-offset-x=
"100" style=
"width: 100px; margin-right: auto"></div>
100 <div data-expected-width=
"100" data-offset-x=
"500" style=
"width: 100px;"></div>
103 <!-- The justify-content does nothing here because we are shrinking. -->
104 <div class=
"flexbox" style=
"justify-content: flex-end">
105 <div data-expected-width=
"200" data-offset-x=
"0" style=
"flex: 0 1 300px;"></div>
106 <div data-expected-width=
"200" data-offset-x=
"200" style=
"width: 200px;"></div>
107 <div data-expected-width=
"200" data-offset-x=
"400" style=
"width: 200px;"></div>
110 <!-- We overflow the flexbox (no negative flexing) and align the end. The overflow is to the left. -->
111 <div class=
"flexbox" style=
"justify-content: flex-end">
112 <div data-expected-width=
"300" data-offset-x=
"-100" style=
"flex: 1 0 300px;"></div>
113 <div data-expected-width=
"200" data-offset-x=
"200" style=
"width: 200px;"></div>
114 <div data-expected-width=
"200" data-offset-x=
"400" style=
"width: 200px;"></div>