A blog for technology, SEO tips, website development and open source programming.

How to center a Youtube iframe on a page

2 9,129

The post will show to center a youtube iframe on a page with html and css only. To make you iframe center you need to give your videowrapper a specific width and make the margin left and right as auto.




Follow me on Instagram

HTML 4 Example

HTML 5 Example

Follow me on Twitter


Follow me on Github

Subscribe to my Youtube Channel

2 Comments
  1. Jules says

    Thanks for that. I was half way there, but had a huge gap between videos. This is the only tutorial I found that actually worked. I did remove the coloured borders though.

    1. Panayiotis Georgiou says

      Thanks Jules, really nice to hear that!

Leave a Reply

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More