• Resolved rdkoff

    (@rdkoff)


    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; 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 to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author FameThemes

    (@famethemes)

    Hello @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

    (@rdkoff)

    Hi @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.