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=”https://www.youtube.com/embed/jum3hZyqVP4?rel=0&#8243; frameborder=”0″ allowfullscreen=”” style=”position: absolute; top: 0; left: 0; width: 100%; height: 100%;”></iframe>

</div>

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: http://www.w3schools.com/css/css_howto.asp

Div: http://www.w3schools.com/html/html_blocks.asp
iFrame: http://www.w3schools.com/html/html_iframe.asp

 

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s