Make your YouTube embed field responsive

I use the media module on this site to embed videos from my YouTube channel but the rendered videos were not responsive. I was lazy for over a year but today I thought of fixing it. Quick search on google and I found this link.

  1. .field--name-field-media-oembed-video{
  2.   position: relative;
  3. }
  5. .field--name-field-media-oembed-video:after {
  6.   content: '';
  7.   display: block;
  8.   padding-bottom: 56.25%;
  9. }
  11. .field--name-field-media-oembed-video iframe {
  12.   position: absolute;
  13.   top: 0;
  14.   right: 0;
  15.   bottom: 0;
  16.   left: 0;
  17.   width: 100%;
  18.   height: 100%;
  19.   margin: 0;
  20. }


* indicates required

Please confirm that you would like to from Sparxsys:

You can unsubscribe at any time by clicking the link in the footer of our emails. For information about our privacy practices, please visit our website.

We use Mailchimp as our marketing platform. By clicking below to subscribe, you acknowledge that your information will be transferred to Mailchimp for processing. Learn more about Mailchimp's privacy practices.

Want to contact me?