CSS RWD Videos


The video element is much like the picture element. We can also make it responsive by setting its width to a percentage value.

Example 1:

In the video element below, we used "100%" value so it scales simultaneously with container. Don't forget to specify the height to "auto" to make it responsive.

Using the Max-Width Property

The video above scales more than its original aspect ratio. We will use max-width property for the next example.

Example 2:

For the fix, we need to set the max-width to 100%. Resize your browser to see the effect.