| <!DOCTYPE html> |
| <html> |
| <head> |
| <style> |
| .container { |
| position: relative; |
| margin: 20px; |
| width: 300px; |
| height: 300px; |
| border: 1px solid black; |
| } |
| .box { |
| position: absolute; |
| left: 50px; |
| top: 50px; |
| z-index: 0; |
| width: 200px; |
| height: 200px; |
| } |
| .middle { |
| background-color: red; |
| } |
| .child { |
| background-color: green; |
| top: 0; |
| left: 0; |
| } |
| .composited { |
| transform: translateZ(0); |
| } |
| </style> |
| </head> |
| <body> |
| <div class="composited container"> |
| <div id="target" class="middle box"> |
| <div class="child composited box"></div> |
| </div> |
| </div> |
| </body> |
| </html> |