Support » Theme: Pinnacle » How to center YouTube videos

  • Resolved lauratraveler

    (@lauratraveler)


    Hi,

    I’ve been using this code `<div style=”text-align: center;”>
    [kad_youtube url=”https://www.youtube.com/watch?v=xxx” width=”560″ height=”315″ maxwidth=”560″ ]
    </div>` but the YouTube video doesn’t stay centered on the page. Can you please let me know what’s the solution?

    Thanks a lot,
    Laura

Viewing 5 replies - 1 through 5 (of 5 total)
  • hannah

    (@hannahritner)

    Hey,
    Can you post a link to where you’ve added this?
    Thanks!

    Hannah

    lauratraveler

    (@lauratraveler)

    Hi Hannah,

    Sure, here’s the link https://www.bylauraiancu.com/smart-blog-planner-special
    The video is pretty large and I’m using a page builder, so it has large margins, but on 13″ screens, you can already see that it’s not centered. This will be even more visible on larger screens.

    Thanks,
    Laura

    Kevin

    (@jx-3p)

    Not sure why it’s not centering, probably a setting within page builder. But here’s some CSS that should take care of that for you:

    .kad-youtube-shortcode.videofit {
        margin-right: auto;
        margin-left: auto;
    }

    -Kevin

    lauratraveler

    (@lauratraveler)

    Thank you, Kevin. That worked! 🙂

    Kevin

    (@jx-3p)

    Just be aware that the CSS isn’t all that specific and will effect any youtube video that you add to your site.

    -Kevin

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How to center YouTube videos’ is closed to new replies.