3 <link href=
"resources/flexbox.css" rel=
"stylesheet">
10 background-color: #aaa;
18 .flexbox :nth-child(
1) {
19 background-color: blue;
21 .flexbox :nth-child(
2) {
22 background-color: green;
24 .flexbox :nth-child(
3) {
25 background-color: red;
44 <script src=
"../../resources/check-layout.js"></script>
45 <body onload=
"checkLayout('.flexbox')">
47 <div data-expected-width=
"200" class=
"flex1-0-0"></div>
48 <div data-expected-width=
"100" data-offset-x=
"250" class=
"flex-none" style=
"width: 100px; margin: 0 50px;"></div>
49 <div data-expected-width=
"200" data-offset-x=
"400" class=
"flex1-0-0"></div>
52 <div data-expected-height=
"120" class=
"flexbox">
53 <div data-expected-width=
"200" data-offset-y=
"50" class=
"flex1-0-0" style=
"margin: 50px 0;"></div>
54 <div data-expected-width=
"100" data-offset-x=
"250" class=
"flex-none" style=
"width: 100px; margin: 0 50px"></div>
55 <div data-expected-width=
"200" data-offset-x=
"400" class=
"flex1-0-0"></div>
58 <!-- Margins set to auto get space only if there's space available after flexing. -->
60 <div data-expected-width=
"200" class=
"flex1-0-0"></div>
61 <div data-expected-width=
"200" data-offset-x=
"200" class=
"flex-none" style=
"width: 200px; margin: 0 auto"></div>
62 <div data-expected-width=
"200" data-offset-x=
"400" class=
"flex1-0-0"></div>
66 <div data-expected-width=
"100" class=
"flex1-0-0"></div>
67 <div data-expected-width=
"300" data-offset-x=
"100" style=
"flex: 2 0 100px; margin-left: auto;"></div>
68 <div data-expected-width=
"100" data-offset-x=
"400" class=
"flex1-0-0" style=
"margin-right: 100px"></div>
71 <!-- Margins set to auto don't have negative flex. -->
73 <div data-expected-width=
"150" style=
"flex: 1 1 300px;"></div>
74 <div data-expected-width=
"300" data-offset-x=
"150" style=
"flex: 1 0 300px; margin: 0 auto;"></div>
75 <div data-expected-width=
"150" data-offset-x=
"450" style=
"flex: 1 1 300px;"></div>
79 <div data-expected-width=
"300" data-offset-x=
"150" style=
"flex: 0 0 300px; margin: 0 auto;"></div>
82 <!-- margin: auto safe centers, which means it won't overflow to before the start of the flexbox. -->
84 <div data-expected-width=
"700" data-offset-x=
"0" style=
"flex: 0 0 700px; margin: 0 auto;"></div>
88 <div data-expected-width=
"600" data-offset-x=
"0" style=
"flex: 1 0 300px; margin: 0 auto;"></div>
92 <div data-expected-width=
"600" data-offset-x=
"0" class=
"flex4" style=
"margin: 0 auto;">
93 <div style=
"width: 100px; height: 100%;"></div>
97 <div class=
"flexbox" style=
"margin: 100px;">
98 <div data-expected-width=
"300" data-offset-x=
"0" class=
"flex1" style=
"margin: 0 auto;"></div>
99 <div data-expected-width=
"300" data-offset-x=
"300" class=
"flex1" style=
"margin: 0 auto;"></div>
102 <div class=
"flexbox" style=
"padding: 100px;">
103 <div data-expected-width=
"300" data-offset-x=
"100" style=
"flex: 1 0 0px; margin: 0 auto;"></div>
104 <div data-expected-width=
"300" data-offset-x=
"400" style=
"flex: 1 0 0em; margin: 0 auto;"></div>
107 <div class=
"flexbox">
108 <div data-expected-width=
"75" data-offset-x=
"0" class=
"flex1-0-0" style=
"margin: 0 auto;"></div>
109 <div data-expected-width=
"350" data-offset-x=
"75" class=
"flex2-0-0" style=
"padding: 0 100px;"></div>
110 <div data-expected-width=
"75" data-offset-x=
"525" class=
"flex1-0-0" style=
"margin-left: 100px;"></div>