| <!DOCTYPE html> |
| <html> |
| <head> |
| <style> |
| .container { |
| position: absolute; |
| margin: 40px; |
| padding: 50px; |
| width: 400px; |
| height: 300px; |
| border: 1px solid black; |
| } |
| |
| .caption-container { |
| position: absolute; |
| top: 0; |
| left: 0; |
| width: 100%; |
| height: 100%; |
| box-shadow: 0 0 10px black; |
| } |
| |
| .caption { |
| position: absolute; |
| width: 300px; |
| bottom: 20px; |
| text-align: center; |
| height: 100px; |
| background-color: blue; |
| } |
| |
| .child { |
| position: absolute; |
| top: 10px; |
| left: 320px; |
| width: 100px; |
| height: 100px; |
| background-color: blue; |
| } |
| .composited { |
| transform: translateZ(0); |
| background-color: silver; |
| } |
| </style> |
| </head> |
| <body> |
| <div class="container"> |
| <div class="composited">composited</div> |
| |
| <div class="caption-container"> |
| <div class="caption"> |
| This should move, not duplicate |
| <div class="child"> |
| child |
| </div> |
| </div> |
| </div> |
| </div> |
| </body> |
| </html> |