Jump to content

how to make YouTube videos responsive in WHMCS?


Recommended Posts

1 hour ago, brian! said:

the quickest way would be to make the width of the iframe 100%...

Zlrnkbg.png

xbwuJAu.png

to do that in WHMCS, you would use the "Source Code" option when editing the kb article...

UYE4pX5.png

Thank you. It worked fine for mobile, but if I visit that article in my desktop computer it looks weird:

 

 

5ge4us.png

Link to comment
Share on other sites

22 hours ago, ocastaned said:

Thank you. It worked fine for mobile, but if I visit that article in my desktop computer it looks weird:

then you might have to wrap it in a div...

<div class="video-container"><iframe src="https://www.youtube.com/embed/Qo002HIvAd0" width="560" height="315" frameborder="0" allowfullscreen="allowfullscreen"></iframe></div>

and then add some CSS code to your template's custom.css file...

.video-container {position:relative; padding-bottom:56.25%; padding-top:30px; height:0; overflow:hidden;}
.video-container iframe, .video-container object, .video-container embed {position:absolute; top:0; left:0; width:100%; height:100%;}

YxAjQfm.pngmUGFsmU.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated