#playerWrap { padding-right: 120px; /* width of the gallery */ height: 600px; max-height: calc(100vh - 50px); position: relative; } #spinGalleryContainer { position: absolute; z-index: 11; width: 120px; height: 100%; right: 0px; top: 0px; } #axZmPlayerContainer { position: relative; height: 100%; } #spinGallery { position: absolute; right: 0; width: 110px; height: 100%; overflow: hidden; } /* hide gallery for small screens */ @media (max-width: 768px) { #spinGalleryContainer { display: none; } #playerWrap { padding-right: 0; height: 400px; } }