box-sizing-007.html (2732B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>CSS Basic User Interface Test: box-sizing:border-box and auto sizing of intrinsicly sized replaced elements.</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-007-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 either both intrinsic dimentions or an intrinsic ratio, to check that they work correctly in terms of the content width height."> 11 <style> 12 img { 13 box-sizing: border-box; 14 width: auto; 15 height: auto; 16 background: white; 17 margin: 10px; 18 } 19 20 #t01, #t11, #t21, #t31 { 21 padding-left: 20px; 22 margin-left: -10px; /*not strictly necessary, but helps preserve alignment, which makes visual verification easier. */ 23 } 24 #t02, #t12, #t22, #t32 { 25 padding-bottom: 20px; 26 margin-bottom: -10px; /*not strictly necessary, but helps preserve alignment, which makes visual verification easier. */ 27 } 28 #t03, #t13, #t23, #t33 { 29 width: 120px; 30 padding-left: 20px; 31 margin-left: -10px; /*not strictly necessary, but helps preserve alignment, which makes visual verification easier. */ 32 } 33 #t04, #t14, #t24, #t34 { 34 height: 120px; 35 padding-bottom: 20px; 36 margin-bottom: -10px; /*not strictly necessary, but helps preserve alignment, which makes visual verification easier. */ 37 } 38 39 #t30, #t32 { 40 width: 100px; 41 } 42 43 #t31 { 44 height: 100px; 45 } 46 body { 47 max-width: 700px; 48 } 49 </style> 50 <body> 51 <p>Test passes if there are 20 <strong>filled green squares</strong> and they are the <strong>same size</strong>.</p> 52 <img id=t00 src="support/w100_h100.svg"> 53 <img id=t01 src="support/w100_h100.svg"> 54 <img id=t02 src="support/w100_h100.svg"> 55 <img id=t03 src="support/w100_h100.svg"> 56 <img id=t04 src="support/w100_h100.svg"> 57 58 <img id=t10 src="support/w100_r1-1.svg"> 59 <img id=t11 src="support/w100_r1-1.svg"> 60 <img id=t12 src="support/w100_r1-1.svg"> 61 <img id=t13 src="support/w100_r1-1.svg"> 62 <img id=t14 src="support/w100_r1-1.svg"> 63 64 <img id=t20 src="support/h100_r1-1.svg"> 65 <img id=t21 src="support/h100_r1-1.svg"> 66 <img id=t22 src="support/h100_r1-1.svg"> 67 <img id=t23 src="support/h100_r1-1.svg"> 68 <img id=t24 src="support/h100_r1-1.svg"> 69 70 <img id=t30 src="support/r1-1.svg"> 71 <img id=t31 src="support/r1-1.svg"> 72 <img id=t32 src="support/r1-1.svg"> 73 <img id=t33 src="support/r1-1.svg"> 74 <img id=t34 src="support/r1-1.svg"> 75 </body>