Use a container, flexbox and absolute positioning to reach a cross-browser compatible solution for this, sth like:
HTML:
<div id="iframe-container">
<iframe></iframe><!-- Paste your iframe here -->
</div>
CSS:
#iframe-container {
display: flex;
justify-content: center;
align-items: center;
position: relative;
overflow: hidden;
}
#iframe-container iframe {
position: absolute;
width: 120%;
height: auto;
}
You may play with the width
and height
values in your CSS to change to cropping as you want. One should be a % - value, and the other one should be auto
, to preserve the aspect ratio.
Additionally, you may move the iframe more specifically by using the top
, left
, bottom
and right
properties on the #iframe-container iframe
element; indicating the distance of the iframe from the top, left, bottom and right border of the container, respectively. Use negative values for these to move the iframe outwards of the borders, and positive to move them inwards from the borders, in the according direction.
With this, you can pretty much place your iframe in whichever place + whichever cropping you may want.