Medio de prueba

The first CSS declarations target the video container and the second target what is in the container, in this case it’s the iframe, you can also apply this to objects and embed elements.

That’s it the video will now scale as the viewport is resized, the magic element is the padding-bottom rule of 56.25%, this figure is reached by using the video’s aspect ratio of 16*9, so 9 divided by 16 = 0.5625 or 56.25%, full explanation in alistapart article.

This same process can also be achieved using a javascript technique explained in the Vimeo video guide, which plays just as friendly with YouTube videos.


Tu dirección de correo electrónico no será publicada. Los campos necesarios están marcados *