Make YouTube Respond

It took some experimenting but this was the code that I used to get Youtube videos to respond to different screen sizes in Moodle using inline styles.

<EXAMPLE: div style=”background-color:black;color:white;padding:20px; position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden;”>

<EXAMPLE: iframe src=”; frameborder=”0″ allowfullscreen=”” style=”position: absolute; top: 0; left: 0; width: 100%; height: 100%;”></iframe>


I found these sites to be helpful in figuring this out. The first link provided the HTML and CSS codes. The other three links explain how to create an inline styles for a DIV and iFrame.

Inline style: