box-sizing-009.html (2074B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Basic User Interface Test: box-sizing:border-box and auto sizing of replaced elements with intrinisic height only.</title> 4 <link rel="author" title="Florian Rivoal" href="http://florian.rivoal.net/"> 5 <link rel="help" href="https://drafts.csswg.org/css-ui-3/#box-sizing"> 6 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-width"> 7 <link rel="help" href="http://www.w3.org/TR/CSS21/visudet.html#inline-replaced-height"> 8 <meta name="flags" content="svg"> 9 <link rel="match" href="reference/box-sizing-009-ref.html"> 10 <meta name="assert" content="Exercises the sizing rules in CSS2.1 10.3.2 and 10.6.2 with box-sizing:border-box for replaced elements with intrinsic height and no intrinsic ratio, to check that they work correctly in terms of the content width height."> 11 <style> 12 #ref { 13 width: 300px; 14 height: 100px; 15 background: green; 16 margin: 10px; 17 display: inline-block; 18 } 19 img { 20 box-sizing: border-box; 21 width: auto; 22 height: auto; 23 background: white; 24 margin: 10px; 25 } 26 27 #t01 { 28 padding-left: 20px; 29 margin-left: -10px; /*not strictly necessary, but helps preserve alignment, which makes visual verification easier. */ 30 } 31 #t02 { 32 padding-bottom: 20px; 33 margin-bottom: -10px; /*not strictly necessary, but helps preserve alignment, which makes visual verification easier. */ 34 } 35 #t03 { 36 width: 320px; 37 padding-left: 20px; 38 margin-left: -10px; /*not strictly necessary, but helps preserve alignment, which makes visual verification easier. */ 39 } 40 #t04 { 41 height: 120px; 42 padding-bottom: 20px; 43 margin-bottom: -10px; /*not strictly necessary, but helps preserve alignment, which makes visual verification easier. */ 44 } 45 body { 46 max-width: 700px; 47 } 48 </style> 49 <body> 50 <p>Test passes if there are 6 <strong>filled green rectangles</strong> and they are the <strong>same size</strong>.</p> 51 <div id="ref"></div> 52 <img id=t00 src="support/h100.svg"> 53 <img id=t01 src="support/h100.svg"> 54 <img id=t02 src="support/h100.svg"> 55 <img id=t03 src="support/h100.svg"> 56 <img id=t04 src="support/h100.svg"> 57 </body>