Center Videos in OneBox


(Iceman) #1

Hi All,

Discourse is really great (first of all) and my team is really loving it.

However, a doubt arised and I tried anything and don’t seem to be able to do it: How do I center a YT video with OneBox? (Or any video) Since the URL can’t be touched with BBCode…

Or maybe is there a way to set the width for the videos so they always appear with the max width?

Sorry for such a n00b question.

Thanks in advance!


#2

Someone posted this css code a while ago and it still works for me (add it on Admin>Customize>Theme, edit a CSS in Common) :

.lazyYT {
    height: 0 !important;
    width: 100% !important;
    padding-bottom: 56.25% !important;
}

But it only works for the youtube videos


(Dungeon Mistress) #3

You can center anything (YT Videos, pictures and text) by using the following:

<div align=center>
picture/text/video
</div>

Looks like this:

This is centered.