.container{ display: flex; position: absolute; justify-content: center; align-items: center; top:50%; left:50%; transform: translate(-50%,-50%); max-width: 100%; } #dropZone { display: flex; flex-direction: column; justify-content: center; align-items: center; width: 300px; height: 300px; background-color: whitesmoke; border: 2px dashed lightgray; z-index: 1000; cursor: pointer; } #dropZone:hover { background-color: rgb(240,240,240); } .imageContainer{ width:500px; margin-left: 20px; } .imageContainer img{ width:100%; }