block-replaced-width-004.xht (1846B)
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN" "http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd"> 2 <html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg"> 3 <head> 4 <title>CSS Test: Block replaced elements and 'auto' specified for 'margin-left', 'margin-right' and no intrinsic height or width</title> 5 <link rel="author" title="Microsoft" href="http://www.microsoft.com/" /> 6 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#block-replaced-width" /> 7 <meta name="flags" content="nonHTML svg" /> 8 <meta name="assert" content="Computed value of 'auto' for 'margin-left' or margin-right' on block replaced elements becomes a used value of '0'. The height and width are adjusted by the constraints for block-level, non-replaced elements." /> 9 <style type="text/css"> 10 #div1 11 { 12 border: solid black; 13 height: 3in; 14 width: 3in; 15 } 16 #div2 17 { 18 height: 110px; 19 width: 3in; 20 } 21 #div3 22 { 23 background: orange; 24 height: 1in; 25 width: 200px; 26 } 27 svg 28 { 29 display: block; 30 } 31 </style> 32 </head> 33 <body> 34 <p>Test passes if the blue and orange boxes below are the same width, and the blue box is in the upper-left corner of the black box.</p> 35 <div id="div1"> 36 <div id="div2"> 37 <svg:svg version="1.1" baseProfile="full"> 38 <svg:rect x="0" y="0" width="200" height="100" fill="blue" /> 39 </svg:svg> 40 </div> 41 <div id="div3"></div> 42 </div> 43 </body> 44 </html>