Jump to content

How to Center Youtube Video Embeds?


Recommended Posts

When someone on the forum embeds a youtube link it doesn't let them center the video in the post with the text editor alignment tools. The only way I've been able to get it centered is to go into the source code and add <center>. Is there a way to get it centered without having to do that extra step?

Link to comment
Share on other sites

  • 2 years later...
1 hour ago, Marc Stridgen said:

Youtube videos by default would be responsive to the width of your site. So there would be nothing to really center here.

There are a few scenarios where centering creates a different look than just a straight posting. For one example, I run a side bar on Pages and also center YouTubes in the main content panel as it gives the Page a better balance than having the 'tube stuck to the left side of the page.

There are other scenarios but I think you get the idea.

Edited by My Sharona
Link to comment
Share on other sites

13 minutes ago, My Sharona said:

There are a few scenarios where centering creates a different look than just a straight posting. For one example, I run a side bar on Pages and also center YouTubes in the main content panel as it gives the Page a better balance than having the 'tube stuck to the left side of the page.

There are other scenarios but I think you get the idea.

I'm not a css person, but maybe try adding this to custom.css.

 

/* Center video */
.ipsEmbeddedVideo {
    text-align:center;
}

Link to comment
Share on other sites

2 minutes ago, Square Wheels said:

I'm not a css person, but maybe try adding this to custom.css.

 

/* Center video */
.ipsEmbeddedVideo {
    text-align:center;
}

Thanks.

I have no real dog in this fight and only occasionally utilize the centering of a 'Tube, so not a big deal for me to hit the 'source' and add code.

I was mainly commenting that there are scenarios where this is desirable.

Link to comment
Share on other sites

21 minutes ago, My Sharona said:

I was mainly commenting that there are scenarios where this is desirable.

If you'd like to see something added, I would advise on placing your suggestion in our official Feature Suggestion forum for further evaluation for a future release.

Link to comment
Share on other sites

3 hours ago, Marc Stridgen said:

Youtube videos by default would be responsive to the width of your site. So there would be nothing to really center here.

I have pasted as "centered" with editors button

Could contain: File

 

and the code

 

<div class="ipsEmbeddedVideo" contenteditable="false">
	<div>
		<iframe allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="" frameborder="0" height="113" src="https://www.youtube.com/embed/KYhFtMKNId4?feature=oembed" width="200"></iframe>
	</div>
</div>

<p style="text-align: center;">
	&nbsp;
</p>

 

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Upcoming Events

    No upcoming events found
×
×
  • Create New...