[For 1.8] make youtube videos responsive
not sure if this was covered or not. 

Recently I came up with the problem. 
Even using responsive theme when inserting youtube videos they were still not responsive and looked really bad on any mobile phone. 

Checking the code I've seen they are inserted using iframe with some certain width and height. 

So here is not ideal, but an easy fix I came up with 

Adding this code to your global.css

iframe {
width: 100%    !important;
max-width: 560px; !important;

may look good on your mobile, but way too stretched  on desktop

Hence I added

max-width: 560px  - makes no difference on a mobile, but will not be overstretched on your desktop

Hope this helps someone

Please see before/after screen attached

P.S bear in mind this will affect any iframe, not just youtube.

Attached Files Thumbnail(s)
My forum powered by MyBB https://alhimika.net/forum/

Messages In This Thread
make youtube videos responsive - by Alhimika - 2021-02-26, 12:01 AM
RE: make youtube videos responsive - by [ExiTuS] - 2021-02-26, 09:49 AM

Forum Jump:

Users browsing this thread: 1 Guest(s)