• Resolved san2102

    (@san2102)


    Hi, I added a shortcode embed YT video but the video is not centered.

    [embed width="900" height="600"]https://www.youtube.com/urlofthevideo[/embed]

    Is there a way to add center in this code?

    Thank you for your help and time.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • I added a shortcode embed YT video but the video is not centered

    Why don’t you use the YouTube block? That will give you alignment options, including “center”. And, yes, you can use this with the cover block, as I’ve done in the screenshot below.

    If you prefer to keep the shortcode, you’ll need to use custom CSS to center the video.

    For the first row with only one video, kindly try this:

    .home .wp-block-cover__inner-container p {
    text-align: center;
    }

    And for the row containing two videos, try this code:

    .home .wp-container-3.wp-block-columns {
    text-align: center;
    }

    Standing by for feedback.

    Thread Starter san2102

    (@san2102)

    @gappiah Thank you so much, it is working, the reason I am using shortcode it is because with YT block the video was very small and there was no place to adjust size, and I found this way more flexible to adjust the size of the video.

    Thanks again for your time, very appreciated.

    Thread Starter san2102

    (@san2102)

    Solved Thanks

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

The topic ‘center shortcode embed YT video’ is closed to new replies.