cross-fade-basic.html (1485B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Basic cross-fade() tests</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-basic-ref.html"> 8 <meta name="fuzzy" content="0-1;0-10000"> 9 <style> 10 div { 11 margin: 2px; 12 width: 50px; 13 height: 50px; 14 } 15 .div1 { 16 background-image: cross-fade(50% #f00, 50% #00f); 17 } 18 .div2 { 19 background-image: cross-fade(50% #f00, #00f); 20 } 21 .div3 { 22 background-image: cross-fade(100% #f00, 100% #00f); 23 } 24 .div4 { 25 width: 200px; 26 height: 200px; 27 background: cross-fade( 28 75% url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' style='background: black'><rect fill='red' width='150' height='150'/></svg>"), 29 25% url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200' style='background: black'><rect fill='blue' x='50' y='50' width='150' height='150'/></svg>") 30 ); 31 } 32 </style> 33 </head> 34 <p>These three should all look the same; a dark purple.</p> 35 <div class="div1"></div> 36 <div class="div2"></div> 37 <div class="div3"></div> 38 <p>This should show red and blue translucent squares on a black background, with the red being clearer.</p> 39 <div class="div4"></div> 40 </html>