Making a YouTube Video Responsive
Permalink
I need to put a YouTube video in the middle of the site, but when I use the YouTube Block, it doesn't scale the video responsively. Is there a hidden setting that I am not seeing, or is there a better way to go about this?
Thanks!
Thanks!
Ok so that would go in Custom Template?
You can do or just use it in the main css file and the block picks it up. I have just tested it on a 5.7 site and it worked fine.
Do I need to do anything special to make sure it knows which block is the YouTube block, or is that handled by the .youtube at the top of the code there?
As previously mentioned drop the following code in your main.css or main.less file and all will be fine.
.youtubeBlock{ position: relative; padding-bottom: 56.25%; padding-top: 25px; height: 0} .youtubeBlock iframe{ position: absolute; top: 0; left: 0; width: 100%; height: 100%}
http://www.concrete5.org/documentation/how-tos/designers/make-all-y...
Hope this helps