I had a client ask me how to center their YouTube video on their website today. Typically, this is an easy fix and can be done a few different ways. You can embed an iframe, create a div class with css, or use a plugin.

Embed a YouTube iFrame in WordPress

This tip comes from wpmudev.org. Click here to view original web page.

Frustrated that you can’t get your videos centered in your WordPress posts? Maybe you have a post that looks like this:How to Center a Video in WordPress

With this little trick, however, you will need to get the full embed code (not just the URL).

Once you have the embed code, go the TEXT tab in your editor, and put the your embed code in the middle of the following snippet of code where it says “embed-code.”

<div style=”text-align:center”>embed-code</div>

Here is a YouTube video that shows you exactly what they’re talking about. This video comes courtesy of Traci Reuter.

Just follow along, and you’ll be centering videos like a pro in no time. 😉