Forum for discussing general topics related to Couch.
4 posts Page 1 of 1
Using the kfunctions.php YouTube shortcode as provided in the Couch documentation, I just want to amend the shortcode slightly to align the video in the centre of the column (Bootstrap 4 framework).
I tried adding align-items="center" like this:
Code: Select all
<iframe class="youtube-player" type="text/html" align-items="center" width="$width" height="$height" src="http://www.youtube.com/embed/$video" frameborder="0"></iframe>

but that doesn't work.

Help please?
Hi

Not sure if you solved it already but you could try the following

Code: Select all
<div class="container text-center"> 
<iframe class="youtube-player embed-responsive-item" src="http://www.youtube.com/embed/$video" frameborder="0" allowfullscreen width="50%" height="300px" style="border-radius:20px;background:#ffffff;padding:5px;"></iframe>
</div>


If that don't work, try one of the other following ways

Code: Select all
<iframe class="center-block" width="560" height="315" src="http://www.youtube.com/embed/$video" frameborder="0" allowfullscreen=""></iframe>


Code: Select all
<div class="text-center">
  <iframe width="560" height="315" src="http://www.youtube.com/embed/$video" frameborder="0" allowfullscreen=""></iframe>
</div>
Thanks for your helpful suggestions.
The shortcode for YouTube contained in the documentation has this line of code:
Code: Select all
<iframe class="youtube-player" type="text/html" width="$width" height="$height" src="http://www.youtube.com/embed/$video" frameborder="0"></iframe>


However there is no specification that I could find in any of the css files for a class 'youtube-player'.

I therefore specified the class like this
Code: Select all
<style>
    .youtube-player {
        aspect-ratio: 16 / 9;
        width: 80%;
        margin:auto;
        display:block;
    }
</style>

and all worked as required.
No worries, glad you got it working
4 posts Page 1 of 1
cron