2021-02-26, 12:01 AM
(This post was last modified: 2021-02-26, 12:04 AM by Alhimika. Edited 2 times in total.)
Hi!
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
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.
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.
My forum powered by MyBB https://alhimika.net/forum/