I usually agree with Drinkin People's answer. But I can imagine that everything in fixed positions is far from perfect on a web page. So I realized something else that does what you want, but also scrolls.
The method is based on the calc and vh (viewport height) functions. Therefore, if you decide to use this method, keep in mind if you want to support older browsers.
Here is the fiddle
First we set the width of the container to 100% and its height for calculation (100vh - 20px). 20px is the space specified for your # bottom bar.
Secondly, we set the width and height of the iframe to 100%. Also set the borders to 0, because this may cause a little problem with scroll lists if we don't.
Thirdly, we give the dimensions of the bottom panel. width: 100% and height: 20 pixels;
This will create a full-screen video viewer, with the bottom pane you want. I also added "# more-stuff" for an extra scroll effect. Just delete it if you don't need the scroll effect.
PS: If you replace height: calc (100vh - 20px); with max-height: calc (100vh - 20px). It should also work inside a div container that resizes.
HTML
<div id="iframe-container"> <iframe src="https://www.youtube.com/embed/OYbXaqQ3uuo?autoplay=1&cc_load_policy=0&controls=0&iv_load_policy=3&modestbranding=1&rel=0&showinfo=0"></iframe> </div> <div id="bottom-bar">Lorem Ipsum</div> <div id="more-stuff"></div>
CSS
body { background-color: blue; color: white; margin: 0; } #iframe-container{ height: calc(100vh - 20px); width: 100%; } #iframe-container iframe{ width: 100%; height: 100%; border: 0px; } #bottom-bar{ width: 100%; height: 20px; background-color: black; } #more-stuff{ width:100%; height: 400px; color: yellow; }
source share