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: Percentage widths on INPUT elements with borders</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/016.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 div, div p, div input { margin: 0; border: 0; padding: 0; }
10 div { height: 0; }
11 div p, div input { width: 50%; height: 300px; }
12 div p { background: red; }
13 div input { border: 100px solid green; background: green; display: block; }
14 /* input should be at LEAST 50% wide, it may even be 50% + 200px if
15 the browser doesn't assume box-sizing: border-box. However,
16 there is no way the input can be narrower than the p. */
17 </style>
18 </head>
19 <body>
20 <p>There should be a big green box below with no red present.</p>
21 <div><p></p></div>
22 <div><input></div>
23
24
25 </body>
26 </html>