.custom1 { margin-left: auto !important; margin-right: auto !important; margin: 20px; padding: 20px; } .custom2 { position: relative; height: 0; overflow: hidden; padding-bottom: 90%; } .custom2 iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; padding: 0; margin: 0; } #pdf-responsive { max-width: 800px; max-height: 700px; overflow: hidden; }