Title: Centralize Iframe
Last modified: March 21, 2018

---

# Centralize Iframe

 *  Resolved [rdkoff](https://wordpress.org/support/users/rdkoff/)
 * (@rdkoff)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/centralize-iframe/)
 * Hi,
 * I’m trying to centralize a video via Iframe on my page, problem is that it automatically
   aligns the video to the left after posting. I’m using the following code:
 * .<div class=”col-md-5″ style=”text-align: center;”><iframe src=”[https://www.youtube.com/embed/qcAepM81F-g?rel=0&controls=0&#8243](https://www.youtube.com/embed/qcAepM81F-g?rel=0&controls=0&#8243);
   width=”400″ height=”200″ align=”middle” margin=”auto” frameborder=”0″ allowfullscreen
   =”allowfullscreen”></iframe></div>
 * Already tried:
    – Centralize via the CMS (style=tekst-align) – Add Align middle
   and margin auto – change div class to middle, but this makes the video display
   with large WxH
 * Do you have any tips/tricks to centralize the video?
 * Thanks in advance!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcentralize-iframe%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Theme Author [FameThemes](https://wordpress.org/support/users/famethemes/)
 * (@famethemes)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/centralize-iframe/#post-10104295)
 * Hello [@rdkoff](https://wordpress.org/support/users/rdkoff/),
 * It is impossible to use text-align to center a div or iframe. You can try this:
   `
   <div class=”col-md-5″ style=”display: table; margin: 0 auto;”><iframe src=”https://
   www.youtube.com/embed/qcAepM81F-g?rel=0&controls=0″ width=”400″ height=”200″ 
   align=”middle” margin=”auto” frameborder=”0″ allowfullscreen=”allowfullscreen”
   ></iframe></div>`
 * Let me know!
 *  Thread Starter [rdkoff](https://wordpress.org/support/users/rdkoff/)
 * (@rdkoff)
 * [8 years, 2 months ago](https://wordpress.org/support/topic/centralize-iframe/#post-10106710)
 * Hi [@famethemes](https://wordpress.org/support/users/famethemes/),
 * It worked, thanks for the code!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Centralize Iframe’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/onepress/2.3.17/screenshot.png)
 * OnePress
 * [Support Threads](https://wordpress.org/support/theme/onepress/)
 * [Active Topics](https://wordpress.org/support/theme/onepress/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/onepress/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/onepress/reviews/)

## Tags

 * [centralize](https://wordpress.org/support/topic-tag/centralize/)
 * [iframe](https://wordpress.org/support/topic-tag/iframe/)

 * 2 replies
 * 2 participants
 * Last reply from: [rdkoff](https://wordpress.org/support/users/rdkoff/)
 * Last activity: [8 years, 2 months ago](https://wordpress.org/support/topic/centralize-iframe/#post-10106710)
 * Status: resolved