transform-abspos-003.html (1451B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>CSS Test (Transforms): Containing Block for Fixed Positioning (right/bottom offsets)</title> 5 <link rel="author" title="Keith Schwarz" href="mailto:keith@keithschwarz.com"> 6 <link rel="author" title="Aryeh Gregor" href="mailto:ayg@aryeh.name"> 7 <link rel="help" href="http://www.w3.org/TR/css-transforms-1/#transform-rendering"> 8 <meta name="assert" content='"In the HTML namespace, any value other than 9 'none' for the transform results in the creation of . . . a 10 containing block. The object acts as a containing block for fixed 11 positioned descendants." This means fixed-position elements need to be 12 rooted at a transformed ancestor, rather than the viewport. (This test 13 differs from the previous in that it uses right/bottom properties for 14 positioning instead of left/top.)'> 15 <link rel="match" href="transform-abspos-ref.html"> 16 <style> 17 body > div { 18 width: 100px; 19 height: 200px; 20 transform: translate(50px, 50px); 21 background: gold; 22 } 23 body > div > div { 24 width: 200px; 25 height: 100px; 26 position: fixed; 27 right: -150px; 28 bottom: 0; 29 background: navy; 30 color: gold; 31 } 32 </style> 33 </head> 34 <body> 35 <div> 36 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 37 <div> 38 0 1 2 3 4 5 6 7 8 9 39 </div> 40 </div> 41 </body> 42 </html>