box-sizing-content-box-003

Box Sizing - Content-Box with min/max width/height

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Assertion
box-sizing: content-box should make the element's (percentage) width be the distance from the left content edge to the right content edge and the height be the distance from the top content edge to the bottom content edge.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3  <head>
 4   <title>CSS Test: Box Sizing - Content-Box with min/max width/height</title>
 5   <link rel="author" title="Scott Johnson" href="mailto:sjohnson@mozilla.com">
 6   <link rel="help" href="http://www.w3.org/TR/css3-ui/#box-sizing">
 7   <link rel="match" href="reference/box-sizing-content-box-003-ref.htm">
 8   <meta name="assert" content="box-sizing: content-box should make the element's (percentage) width be the distance from the left content edge to the right content edge and the height be the distance from the top content edge to the bottom content edge.">
 9   <style type="text/css">
10     .container {
11       min-width: 500px;
12       max-width: 700px;
13       height: 90px;
14       border: 2px solid black;
15       position: absolute;
16       left: 25px;
17       top: 25px;
18       background-color: red;
19     }
20 
21     .box-sized {
22       box-sizing: content-box;
23       width: 50%;
24       height: 100%;
25       z-index: 1;
26       float: left;
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>