Padding bottom with max height
Here's the HTML: <div class="container"> <div class="wrapper"> <iframe src="...."></iframe> </div> </div> The wrapper div has CSS: position: relative; width: 100%; height: 100%; height: 0; padding-bottom: 56.25%; overflow: hidden; The iframe has CSS: position: absolute; width: 100%; height: 100%; top: 0; left: 0; border: 0; The container has CSS: position: relative; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; margin: 0 auto; top: 50%; transform: translateY(-50%); max-width: 1280px; max-height: 720px; I'm trying to protect the aspect ratio 16:9 of
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.