1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
7 <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>
9 <link rel="author" title="GĂ©rard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/" />
10 <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" />
11 <meta content="" name="flags" />
12 <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" />
14 <style type="text/css"><![CDATA[
19 border-right: red solid 200px;
26 border-right: green solid 200px;
31 Calculation of used width for div#child:
33 margin-left : 0px (or auto)
34 + border-left-width : 0px
38 + border-right-width : 200px
39 + margin-right : -400px
40 ====================================
41 width of containing block : 0px
43 Therefore 'width: auto' must be resolved as 'width: 200px'.
44 Therefore div#child's green border-right should overlap perfectly
45 div#containing-block's red border-right.
53 <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
55 <div id="containing-block">
56 <div id="child"></div>