Aligning videos to center not working
-
AuthorPosts
-
inasearchofbalance
MemberHi,
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)
maharzan
Theme AuthorHi,
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,
Chandrakathrynwp
Staffmaharzan – let me know what I can do here, thanks!
maharzan
Theme AuthorHi 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,
Chandrakathrynwp
StaffIt 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.
kathrynwp
StaffOur 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.
Work like a charm now, thanks Kathryn!
(I’m using the shortcode embed method, fyi for anyone else reading this)
kathrynwp
StaffGlad you’re set!
- The topic ‘Aligning videos to center not working’ is closed to new replies.