1 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
6 <title>CSS Test: Solving 'width: auto' of a block-level non-replaced element in normal flow with one other property set to an 'auto' value
</title>
8 <link rel=
"author" title=
"GĂ©rard Talbot" href=
"http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
9 <link rel=
"help" title=
"10.3.3 Block-level, non-replaced elements in normal flow" href=
"http://www.w3.org/TR/CSS21/visudet.html#blockwidth">
10 <meta content=
"" name=
"flags">
11 <meta content=
"If 'width' is set to 'auto', any other 'auto' values become '0' and the determination of 'width' proceeds from the following equality: 'margin-left' + 'border-left-width' + 'padding-left' + 'width' + 'padding-right' + 'border-right-width' + 'margin-right' = width of containing block" name=
"assert">
13 <style type=
"text/css">
18 border-right: red solid
200px;
25 border-right: green solid
200px;
30 Calculation of used width for div#child:
32 margin-left : 0px (or auto)
33 + border-left-width : 0px
37 + border-right-width : 200px
38 + margin-right : -400px
39 ====================================
40 width of containing block : 0px
42 Therefore 'width: auto' must be resolved as 'width: 200px'.
43 Therefore div#child's green border-right should overlap perfectly
44 div#containing-block's red border-right.
52 <p>Test passes if there is a filled green square below and
<strong>no red
</strong>.
</p>
54 <div id=
"containing-block">
55 <div id=
"child"></div>