transform-inherit-002.html (1480B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Test (Transforms): 'inherit' and percentages</title> 5 <link rel="author" title="Aryeh Gregor" href="mailto:ayg@aryeh.name"> 6 <link rel="reviewer" title="Apple Inc." href="http://www.apple.com"> 7 <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#transform-property"> 8 <meta name="assert" content='The 'transform' property's 9 computed value (which is what's inherited if 'inherit' is 10 specified) is defined as "As specified, but with relative lengths converted 11 into absolute lengths." In this test, a parent element has a transform of 12 10% with a height/width of 400px, and the child has "transform: inherit" 13 and a height/width of 100px. Since percentages are not relative lengths 14 and are inherited as specified, the parent should be translated by 40px and 15 then the child by only 10px, for a total of 50px. An implementation that 16 incorrectly converted the parent's 10% transform into 40px before 17 inheritance would translate the child by a further 40px, for a total of 18 80px.'> 19 <link rel="match" href="transform-inherit-ref.html"> 20 <style> 21 body { 22 height: 400px; 23 width: 400px; 24 transform: translate(10%, 10%); 25 } 26 div { 27 height: 100px; 28 width: 100px; 29 transform: inherit; 30 background: blue; 31 } 32 </style> 33 </head> 34 <body> 35 <div></div> 36 </body> 37 </html>