My latest coding project involved creating a responsive fullscreen iframe, and for the most part, it's been working really well. However, I encountered an issue with screen resolutions like 1680x1050 (check out the screenshot here). In cases like these, I want to center the iframe on the screen with a black background both above and below it. Additionally, I'd like this same effect to apply when the iframe is in fullscreen mode on a tablet held in portrait orientation.
.FullScreen {
&-target {
position: fixed !important;
top: 0;
right: 0;
bottom: 0;
left: 0;
z-index: 20000;
width: 100vw;
height: 100vh;
background: #0a0a0a;
}
&-button {
cursor: pointer;
font-size: 40px;
&--active {
/*....
....*/
}
}
}
}
<div class="mne-contentBorder js-fullscreen-target FullScreen-target">
<div class="myEMLObj">
<div class="EMLObj-wrapper">
<img class="EMLObj-placeholder" src="data:image/gif;">
<iframe class="myObject-Iframe js-Iframe" src="" name="Iframe" frameborder="0"></iframe>
</div>
</div>
</div>