backface-visibility-hidden-001.html (1797B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Transforms Test: transform property with backface visibility = hidden</title> 5 <link rel="author" title="Jian Zhang" href="mailto:jian.andy.zhang@gmail.com"> 6 <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#transform-property"> 7 <link rel="help" href="http://www.w3.org/TR/css-transforms-2/#propdef-backface-visibility"> 8 <link rel="match" href="reference/backface-visibility-hidden-ref.html"> 9 <meta name="fuzzy" content="maxDifference=0-100;totalPixels=0-300"> 10 <meta name="assert" content="When the value of backface visibility property is 'hidden', the back side of a transformed element is invisible when facing the viewer."> 11 <style type="text/css"> 12 .greenSquare { 13 position: absolute; 14 top: 50px; 15 left: 50px; 16 width: 100px; 17 height: 100px; 18 background: green; 19 z-index: 2; 20 } 21 22 .redSquare { 23 position: absolute; 24 top: 50px; 25 left: 50px; 26 width: 100px; 27 height: 100px; 28 background: red; 29 z-index: 1; 30 transform: rotateY(180deg); 31 } 32 33 .face { 34 backface-visibility: hidden; 35 } 36 37 .card { 38 transform-style: preserve-3d; 39 } 40 41 .container { 42 width: 200px; 43 height: 200px; 44 perspective: 1000px; 45 transform: rotateY(45deg); 46 } 47 48 </style> 49 </head> 50 <body> 51 <p>The test passes if there is a green retangle and no red.</p> 52 <div class="container"> 53 <div class="card"> 54 <div class="redSquare face"></div> 55 <div class="greenSquare face"></div> 56 </div> 57 </div> 58 </body> 59 </html>