<!DOCTYPE html> <html> <head> <style> div { position:relative; width:300px; height:200px; left:50px; top:50px; transform-style:preserve-3d; } .grandparentdiv { background:yellow; overflow:hidden; } .childdiv { background:green; } .grandchilddiv { background:red; } </style> </head> <body> <div class="grandparentdiv"> <div class="childdiv"> <div class="grandchilddiv"></div> </div> </div> </body> </html>