Aligning videos to center not working

  • Author
    Posts
  • #67295

    Hi,

    I’ve been trying to align a video I’m embedding to the center, but it doesn’t seem to work. See here >> https://inasearchofbalance.wordpress.com/2013/06/13/everest/

    I’ve tried with all options that I can think of:
    <div style=”text-align:center”> LINK</div>
    <center>LINK</center>
    <p align=center> LINK </p>

    And a couple of others, but none seem to work. I read somewhere in the forums that it might be a theme specific thing, not WordPress per se because the above code seemed to work for other users.

    Can you please advise?

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

    #67446
    maharzan
    Theme Author

    Hi,

    Can you please try this and see? The video embed code is actually using margin: 0 in inline css so we will have to overwrite that. But I think you do not have a custom css upgrade. You will have to have custom CSS upgrade to use any custom CSS.

    .embed-vimeo iframe, .embed-youtube iframe { margin: auto !important; }

    Thanks,
    Chandra

    #67463
    kathrynwp
    Staff

    maharzan – let me know what I can do here, thanks!

    #67491
    maharzan
    Theme Author

    Hi Kathryn,

    I saw that the video code embeds inline css where margin:0 is set. Is this a theme specific issue as posted above? Even if we center it by default in theme, I think it will be overwritten by the video embed code.

    Thanks,
    Chandra

    #67534
    kathrynwp
    Staff

    It looks like currently it’s not possible to override the left-alignment of responsive videos, but one of our theme wranglers is taking a look at whether that can be changed. For now, custom CSS is the only way to change this display. We’ll keep you posted here if that changes.

    #67654
    kathrynwp
    Staff

    Our developers have made a change which allows responsive videos to be centered if they’re wrapped in a paragraph tag with centering. It should work with both the shortcode embed or with regular embeds:

    <p style="text-align:center;">[youtube=http://www.youtube.com/watch?v=PlblwP2oa-0&w=960&rel=0]</p>

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

    If using the non-shortcode embed method, you’ll need to make sure the video URL is on its own line – you can switch to Text/HTML view to adjust if needed.

    Let me know if you have any questions about this.

    #67655
    inasearchofbalance
    Member
    Original poster

    Work like a charm now, thanks Kathryn!

    (I’m using the shortcode embed method, fyi for anyone else reading this)

    #67656
    kathrynwp
    Staff

    Glad you’re set!

  • The topic ‘Aligning videos to center not working’ is closed to new replies.