<!DOCTYPE HTML> <html> <head> <style> #container { height: 500px; width: 500px; position: relative; overflow: hidden; } #panel { position:absolute; height: 100%; width: 100%; top: 0; left: 0; transform: translateX(0); background-color: yellow; } </style> </head> <body> <div id="container"> <div id="panel"> <div style="width:300px; height:50px; background:blue;"></div> </div> </div>