I'm having issues centering the videos in my site http://goldcommoditytrading.org/ - how can I make the videos be in the center of art-PostContent (I think is the right div in this case) if possible using the divs that are already there. Thanks!
| SitePoint Sponsor |



I'm having issues centering the videos in my site http://goldcommoditytrading.org/ - how can I make the videos be in the center of art-PostContent (I think is the right div in this case) if possible using the divs that are already there. Thanks!


I couldn't access that link - is it correct ?
www.pmob.co.uk CSS FAQ 3 col demo Read My CSS Articles
Ultimate CSS Reference
Check out SitePoint's latest JavaScript challenge


The link works OK for me.
You just need to add text-align: center to the containing <p> element. If you can't put it directly on that element, you could try this:
Code:.art-PostContent p:first-child { text-align: center; }
Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.


www.pmob.co.uk CSS FAQ 3 col demo Read My CSS Articles
Ultimate CSS Reference
Check out SitePoint's latest JavaScript challenge



Thanks Ralph and Paul the video now centers fine, but so does the tweet this button and if I put text before the video. How can I make just the video centered? Thanks
it seems centered to me...


Try this instead of Ralph's code.
Code:.art-PostContent object { display:block; margin:auto; }
www.pmob.co.uk CSS FAQ 3 col demo Read My CSS Articles
Ultimate CSS Reference
Check out SitePoint's latest JavaScript challenge



Thanks Paul, that works great in Firefox, but in IE (only tested with IE9) the second video is not centered although it has the same markup as the first video, I got rid of the p tags just to make sure, why is this happening? Thanks http://www.goldcommoditytrading.org/


Hi,
The problem is that you have set IE to display as the second worst browser in history as you have set it to emulate IE7.
That's like having a new Porsche and putting a lawn mower engine inside (or even a wind up radio).Code:<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
Remove the meta tag and IE9 will display OK and so will IE8.
To fix IE7 add this to the css as well.
Code:.art-PostContent embed { display:block; margin:auto; }
www.pmob.co.uk CSS FAQ 3 col demo Read My CSS Articles
Ultimate CSS Reference
Check out SitePoint's latest JavaScript challenge



Thanks Paul, yeah it's a theme so I can't take credit for the css lol
That works great now, now I can start tarting it up a bit and getting rid of the space at the top in IE! Cheers!


Facebook | Google+ | Twitter | Web Design Tips | Free Contact Form
Try your hand at the new JavaScript Challenge!
If you don't like getting your feet stuck in a bog, avoid Twitter BootsTrap.
Bookmarks