|
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
|
2 <html xmlns="http://www.w3.org/1999/xhtml"> |
|
3 <head> |
|
4 <title>CSS Reference: Box Sizing - Border-Box with min/max width/height</title> |
|
5 <link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com" /> |
|
6 <style type="text/css"><![CDATA[ |
|
7 .container { |
|
8 min-width: 500px; |
|
9 max-width: 700px; |
|
10 min-height: 70px; |
|
11 max-height: 90px; |
|
12 border: 2px solid black; |
|
13 position: absolute; |
|
14 left: 25px; |
|
15 top: 25px; |
|
16 background-color: red; |
|
17 } |
|
18 |
|
19 .box-sized { |
|
20 min-width: 240px; |
|
21 max-width: 340px; |
|
22 min-height: 60px; |
|
23 max-height: 80px; |
|
24 z-index: 1; |
|
25 float: left; |
|
26 border: 5px solid black; |
|
27 } |
|
28 |
|
29 #one { |
|
30 background-color: green; |
|
31 } |
|
32 |
|
33 #two { |
|
34 background-color: blue; |
|
35 } |
|
36 ]]></style> |
|
37 </head> |
|
38 <body> |
|
39 The two divs should be side-by-side, not one on top of another. No red should be visible. |
|
40 <br /> |
|
41 <div class="container"> |
|
42 <div class="box-sized" id="one">LEFT HALF</div> |
|
43 <div class="box-sized" id="two">RIGHT HALF</div> |
|
44 </div> |
|
45 </body> |
|
46 </html> |