cross-fade-natural-size.html (1550B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Natural size of cross-fade()</title> 5 <link rel="author" title="Steinar H. Gunderson" href="mailto:sesse@chromium.org"> 6 <link rel="help" href="https://drafts.csswg.org/css-images-4/#cross-fade-function"> 7 <link rel="match" href="cross-fade-natural-size-ref.html"> 8 <meta name="fuzzy" content="0-1;0-300000"> 9 <style> 10 div { 11 margin: 2px; 12 } 13 .div1::before { 14 content: cross-fade( 15 75% url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400' style='background: black'><rect fill='red' width='150' height='150'/></svg>"), 16 25% url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='200' style='background: black'><rect fill='blue' width='150' height='150'/></svg>") 17 ); 18 } 19 .div2::before { 20 content: cross-fade( 21 37.5% url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='400' height='400' style='background: black'><rect fill='red' width='150' height='150'/></svg>"), 22 12.5% url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='200' style='background: black'><rect fill='blue' width='150' height='150'/></svg>"), 23 green 24 ); 25 } 26 </style> 27 </head> 28 <p>This image should be 375x350, with a black background.</p> 29 <div class="div1"></div> 30 <p>This image should be identical in both size and appearance, except for a green tinge.</p> 31 <div class="div2"></div> 32 </html>