blocks-015

CSS Block Box Model: sane horizontal box model and minimum widths

WeasyPrint

This browser

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html lang="en">
 3 <head>
 4   <title>CSS Test: CSS Block Box Model: sane horizontal box model and minimum widths</title>
 5   <link rel="author" title="Ian Hickson" href="mailto:ian@hixie.ch">
 6   <link rel="alternate" href="http://www.hixie.ch/tests/adhoc/css/box/block/005.html" type="text/html">
 7   <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#the-width-property">
 8   <style type="text/css">
 9    .container { width: 5em; }
10    .test { margin-left: 0; border-left: none; padding-left: 2em; width: auto; padding-right: 2em; border-right: none; margin-right: 0; }
11    .control { margin-left: 0; border-left: none; padding-left: 0; width: 5em; padding-right: 0; border-right: none; margin-right: 0; }
12    div { background: navy; height: 1em; }
13   </style>
14  </head>
15  <body>
16   <p>There must be a perfectly rectangular blue box below.</p>
17   <div class="container">
18     <div class="test"></div>
19   </div>
20   <div class="control"></div>
21  
22 
23 </body>
24 </html>