|
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 with margin/border on flex items. --> |
|
7 <html xmlns="http://www.w3.org/1999/xhtml"> |
|
8 <head> |
|
9 <title>CSS Test: Testing margins and borders on flex items in a horizontal flex container</title> |
|
10 <link rel="author" title="Daniel Holbert" href="mailto:dholbert@mozilla.com"/> |
|
11 <link rel="help" href="http://www.w3.org/TR/css3-flexbox/#layout-algorithm"/> |
|
12 <link rel="match" href="flexbox-mbp-horiz-2-ref.xhtml"/> |
|
13 <style> |
|
14 div { height: 100px; border: 0; } |
|
15 div.flexbox { |
|
16 width: 200px; |
|
17 font-size: 10px; |
|
18 display: flex; |
|
19 } |
|
20 div.a { |
|
21 flex: 1 0 20px; |
|
22 background: lightgreen; |
|
23 margin-left: 1px; |
|
24 margin-right: 3px; |
|
25 border-style: dotted; |
|
26 border-left-width: 2px; |
|
27 border-right-width: 4px; |
|
28 } |
|
29 div.b { |
|
30 flex: 2 0 4px; |
|
31 background: yellow; |
|
32 margin-left: 2px; |
|
33 margin-right: 4px; |
|
34 border-style: dashed; |
|
35 border-left-width: 7px; |
|
36 border-right-width: 3px; |
|
37 } |
|
38 div.c { |
|
39 flex: 3 0 40px; |
|
40 background: orange; |
|
41 } |
|
42 div.flexNone { |
|
43 flex: none; |
|
44 background: pink; |
|
45 } |
|
46 div.flexBasis { |
|
47 flex: 0 0 20px; |
|
48 background: gray; |
|
49 } |
|
50 div.spacer { |
|
51 display: inline-block; |
|
52 width: 15px; |
|
53 height: 15px; |
|
54 background: purple; |
|
55 } |
|
56 </style> |
|
57 </head> |
|
58 <body> |
|
59 <div class="flexbox"><div class="a"></div><div class="b"/></div> |
|
60 <div class="flexbox"><div class="a"/><div class="c"/></div> |
|
61 <div class="flexbox"><div class="a"/> |
|
62 <div class="flexNone"><div class="spacer"/></div> |
|
63 </div> |
|
64 <div class="flexbox"><div class="b"/><div class="c"/></div> |
|
65 <div class="flexbox"><div class="b"/> |
|
66 <div class="flexNone"><div class="spacer"/><div class="spacer"/></div> |
|
67 </div> |
|
68 |
|
69 <div class="flexbox"> |
|
70 <div class="a"/><div class="b"/><div class="flexBasis"/><div class="c"/> |
|
71 </div> |
|
72 </body> |
|
73 </html> |
|
74 |