border-image-017

border-image shorthand - with border-image-slice and border-image-width

WeasyPrint

Reference (good) by WeasyPrint

Reference (good) by this browser

This browser

Flags
image
Assertion
Percentage values for 'border-image-slice' are relative to the size of the image: the width of the image for the horizontal (left and right) offsets, the height for vertical (top and bottom) offsets. 'border-image-slice' specifies inward offsets from the top, right, bottom, and left edges (in that order) of the image. In this test, the image serving as 'border-image-source' is a 100px by 100px image which has 5px of green at the top, 10px of green on the right, 15px of green at the bottom and 20px of green at the left; the remaining center (which has a width of 70px and a height of 80px) is all red.

Source

 1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
 2 <html>
 3 
 4  <head>
 5 
 6   <title>CSS Backgrounds and Borders Test: border-image shorthand - with border-image-slice &lt;percentage&gt; and border-image-width &lt;percentage&gt;</title>
 7 
 8   <link rel="author" title="Gérard Talbot" href="http://www.gtalbot.org/BrowserBugsSection/css21testsuite/">
 9   <link rel="help" href="http://www.w3.org/TR/css3-background/#the-border-image" title="6.7. Border Image Shorthand: the 'border-image' property">
10   <link rel="match" href="reference/ref-filled-green-100px-square.htm">
11   <meta name="flags" content="image">
12   <meta name="assert" content="Percentage values for 'border-image-slice' are relative to the size of the image: the width of the image for the horizontal (left and right) offsets, the height for vertical (top and bottom) offsets. 'border-image-slice' specifies inward offsets from the top, right, bottom, and left edges (in that order) of the image. In this test, the image serving as 'border-image-source' is a 100px by 100px image which has 5px of green at the top, 10px of green on the right, 15px of green at the bottom and 20px of green at the left; the remaining center (which has a width of 70px and a height of 80px) is all red.">
13 
14   <style type="text/css">
15   div#test
16   {
17   border-color: red;
18   border-style: solid;
19   border-width: 15px 20px 35px 30px;
20   border-image: url("support/outline-5px-10px-15px-20px-green.png") 5% 10% 15% 20% / 15% 20% 35% 30% / 0 repeat repeat;
21 
22   /*
23   Equivalent to this shorthand form (see border-image-018 test):
24   border-image: url("support/outline-5px-10px-15px-20px-green.png") 5 10 15 20 / 15% 20% 35% 30% / 0 repeat repeat;
25 
26   or to this shorthand form (see border-image-019 test):
27   border-image: url("support/outline-5px-10px-15px-20px-green.png") 5% 10% 15% 20% / 1 1 1 1 / 0 repeat repeat;
28 
29   or to this shorthand form (see border-image-020 test):
30   border-image: url("support/outline-5px-10px-15px-20px-green.png") 5 10 15 20 / 1 1 1 1 / 0 repeat repeat;
31   */
32 
33   width: 50px;
34   }
35 
36   img {vertical-align: top;}
37 
38   div#overlapped-red
39   {
40   background-color: red;
41   bottom: 100px;
42   height: 100px;
43   position: relative;
44   width: 100px;
45   z-index: -1;
46   }
47   </style>
48 
49  </head>
50 
51  <body>
52 
53   <p>Test passes if there is a filled green square and <strong>no red</strong>.</p>
54 
55   <div id="test"><img src="support/50x50-green.png" alt="Image download support must be enabled"></div>
56 
57   <div id="overlapped-red"></div>
58 
59  </body>
60 </html>