border-image-slice-005.htm (2487B)
1 <!DOCTYPE html> 2 3 <meta charset="UTF-8"> 4 5 <title>CSS Test: The 'border-image-slice' property with four percentage values</title> 6 <link rel="author" title="Microsoft" href="http://www.microsoft.com/"> 7 <!-- 8 Test rehabilitated by Gérard Talbot 9 2020-05-27 and 2020-09-28 10 --> 11 <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-image-slice"> 12 <link rel="match" href="reference/border-image-slice-005-ref.html"> 13 <meta name="fuzzy" content="maxDifference=0-92;totalPixels=0-5314"> 14 <meta name="assert" content="This test checks that the border image is sliced into nine regions with inward offsets, '40%' from the top, '30%' from the right,'20%' from the bottom, and '10%' from the left edges of the image. Percentages are relative to the size of the image: the width of the image for the horizontal offsets, the height for vertical offsets."> 15 <style> 16 div 17 { 18 background-color: orange; 19 border-color: red; 20 border-style: double; 21 border-width: 40px; 22 border-image-slice: 40% 30% 20% 10%; 23 /* 24 The original test was using 'border-image-slice: 40% 15% 20% 5%'. 25 */ 26 border-image-source: url("support/9grid40-30-20-10-red.png"); 27 /* 28 The top side uses 3 blue borders of 24px wide interleaved with 2 29 transparent areas of 24px wide. 30 So: 5 times 24px == 120px which is 40% of 300px 31 32 The right side uses 3 blue borders of 18px wide interleaved with 2 33 transparent areas of 18px wide. 34 So: 5 times 18px == 90px which is 30% of 300px 35 36 The bottom side uses 3 blue borders of 4px wide interleaved with 2 37 transparent areas of 12px wide. 38 So: 5 times 12px == 60px which is 20% of 300px 39 40 The left side uses 3 blue borders of 6px wide interleaved with 2 41 transparent areas of 6px wide. 42 So: 5 times 6px == 30px which is 10% of 300px 43 */ 44 height: 100px; 45 margin: 50px; 46 width: 200px; 47 } 48 </style> 49 50 <p>Test passes if there is a filled orange rectangle inside 3 blue borders interleaved with 2 orange borders and <strong>no red</strong>. 51 52 <div></div>