OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 |
| 3 <!-- |
| 4 The perspective origin should be centered in the container's border box, |
| 5 regardless of the presence of scrollbars. |
| 6 --> |
| 7 |
| 8 <style> |
| 9 .container { |
| 10 background-color: green; |
| 11 border: 10px solid black; |
| 12 overflow: hidden; |
| 13 position: relative; |
| 14 width: 100px; |
| 15 height: 100px; |
| 16 margin: 10px 0; |
| 17 perspective: 500px; |
| 18 } |
| 19 .scroller { |
| 20 position: absolute; |
| 21 left: 0; |
| 22 top: 0; |
| 23 right: 0; |
| 24 bottom: 0; |
| 25 overflow: scroll; |
| 26 } |
| 27 .transformed { |
| 28 background-color: blue; |
| 29 width: 50px; |
| 30 height: 50px; |
| 31 transform: translateZ(-1000px); |
| 32 } |
| 33 </style> |
| 34 |
| 35 <div class="container"> |
| 36 <div class="transformed"></div> |
| 37 <div class="scroller"></div> |
| 38 </div> |
| 39 |
| 40 <!-- This blue box should be smaller because it should be obscured by the border
. --> |
| 41 <div class="container" style="perspective-origin: 0 0"> |
| 42 <div class="transformed"></div> |
| 43 <div class="scroller"></div> |
| 44 </div> |
| 45 |
| 46 <div class="container" style="perspective-origin: 60% 40px"> |
| 47 <div class="transformed"></div> |
| 48 <div class="scroller"></div> |
| 49 </div> |
OLD | NEW |