3

I need to implement a video, which it fills up the container. It is required to use pure CSS, instead of using Javascript.

I have browsed through the internet, and I concluded that there are 2 pure-CSS approaches to this problem, but they still have their own flaws.

  1. min-height and transform: Using this is the worst solution so far, since the video will expand to its original width and height. And if the container is much smaller than the video, the display is kinda weird.

  2. object-fit: This seems the best solution up to date, but... IE doesn't support (still this classic problem).

Is there an efficient and cross-browser ways (even workaround, hacks, etc.) on using only CSS. Any help is appreciated!

Here is my codepen to summarize my problem as well.

https://codepen.io/thaido-solislab/pen/GzYjqG

Tyler Bean
  • 417
  • 1
  • 4
  • 14

0 Answers0