Centering YouTube Videos

  • Unknown's avatar

    I’ve been trying to figure out how to center YouTube videos on my site oneyearfilmmaker.wordpress.com.

    All the resources I’ve found say to use the following format and place this in the HTML editor.

    [youtube=https://www.youtube.com/watch?v=ivfspJOAtBI&w=560&h=315]

    However, when I do this, it successfully resizes the video but it does not align the video to the center. When I refresh the page it very briefly shows the video in the center but then the video jumps to the left. I’ve checked this in multiple browsers and the same thing happens every time.

    Can anyone help?

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar
    oneyearfilmmaker · Member ·

    It looks like the forum software here weirdly changed the code I posted.

    Here’s the method I’m using to try to center YouTube videos but it’s not working:

    http://www.wpbeginner.com/beginners-guide/beginners-guide-how-to-center-align-a-video-in-wordpress/

  • Unknown's avatar

    Hi there,

    I see all your videos aligned perfectly in the center. Please upload a screenshot in Cloudup or Snag.gy if you still face an issue.

    Take a Screenshot

    Thank you.

  • Unknown's avatar
    oneyearfilmmaker · Member ·

    Well those are centered because they’re taking up the whole screen.

    This started with me trying to make the videos smaller and then I realized they aren’t centered when I do that.

    I just created a test post that shows you what I’m talking about and that post is using the code mentioned in the article I posted earlier.

    Here’s your screenshot:

  • Unknown's avatar

    Hi there,

    If you see your theme demo and documentation, it indicates that

    ” Featured Images and other images greater than 1100px wide will display in a big, bold way, outdented from the surrounding content.”

    https://wordpress.com/theme/independent-publisher-2

    That is how the theme is designed.

    Thank you.

  • @oneyearfilmmaker can you link us to a post where you’re attempting to center smaller videos?

  • Unknown's avatar
    oneyearfilmmaker · Member ·

    @supernovia I eventually just gave up and switched to a different theme, which apparently centers the videos on its own.

    On the old theme I was using (Independent Publisher 2) if I used the code from the article I posted earlier, the videos would center very briefly and then jump to the left. Not sure exactly what the issue was or if it was a limitation of that theme, but I just gave up and a workaround (i.e. a different theme).

    It seems very strange to me though that any theme would have a limitation of just not being able to center something like a YouTube video.

  • Okay. If you’d like us to troubleshoot this let us know; if you’re happy with the current theme we’ll leave it as is for now. What would you like to do?

  • The topic ‘Centering YouTube Videos’ is closed to new replies.