Center Videos in OneBox

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!

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

4 Likes

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.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.