I have an iframe inside a div like:
<section> <div> <iframe></iframe> </div> </section>
the iframe contains a YouTube video, but that probably doesn't matter.
I create a mosaic and try to use a div to crop the iframe to the appropriate size.
this is done
.section {height: 251px; width: 198px; overflow: hidden}
Works great, but I would also like to focus the video. For images, I add them as background images and use
background-size: cover
to center them. This is neat because they automatically scale to the maximum possible size. However, this does not work for video. I would agree to simply center the iframe vertically and horizontally, if possible.
source share