I have a youtube video on this page to resize for mobile width on mobile but retain size on desktop. Any thoughts as to how I can do this? I don’t see anything in the responsive section. Here is the page https://truthbook.com/
I would like to retain the video ratio but resize for mobile. I.e, play without the black bars showing.
Hi hostworks,
Please try to add this CSS code in Enfold > General Styling > Quick CSS:
@media only screen and (max-width:767px) {
#top iframe {
height: auto;
}
}
Best regards,
Nikko
Nikko,
Thanks, that is much better, When the video starts, you will notice that there are vertical black bars on the outside of the video. I’m using the correct ratio on the desktop; how can I properly display the ratio on mobile?
<iframe width=”1000″ height=”563″ src=”https://www.youtube.com/embed/e3ZHO7xKEpQ” title=”YouTube video player” frameborder=”0″ allow=”accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture” allowfullscreen></iframe>
Oops, forgot mobile screenshot.
https://truthbook.com/wp-content/uploads/2022/07/The-Complete-Life-of-Jesus.-The-Urantia-Book-free-and-online-at-Truthbook.jpg
Hi hostworks,
Please try to use this CSS code instead:
@media only screen and (max-width:767px) {
#top iframe {
height: auto;
aspect-ratio: 16 / 9;
}
}
Hope it helps.
Best regards,
Nikko
Nikko,
That did the trick! Thank you very much. You can close this ticket. Enfold rocks again.
Hi,
Glad Nikko was able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.
Best regards,
Mike