• Resolved woodstockblackfeather

    (@woodstockblackfeather)


    Hello,

    Hello,
    I would be forever grateful if someone could help me out. I am trying to center an mp4 in a post and no matter what I try, the video stays left aligned. I have tried all the suggestions in previous forums but unfortunately nothing is working. I have pasted my current html and css code below along with the link to the page. I know it is probably something very silly so I apologise in advance…

    The html is:

    <div id="video">
    [video width="640" height="415" align="center" mp4="https://flycruisestay.com/wp-content/uploads/2016/04/Winter-in-Georgia.mp4"][/video]
    </div>

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been damaged by the forum’s parser.]

    The css is:
    .video{
    align: center;
    margin: 0 auto;
    }
    The link is: It is the second video that I am trying to centre, I have no problem centering embedded videos but I just can’t center the mp4
    https://flycruisestay.com/georgia/
    Thanks again

Viewing 3 replies - 1 through 3 (of 3 total)
  • Try using Firefox with the Firebug add-on for this kind of CSS troubleshooting. Or use whatever developer tool is available in your web browser.

    First off the css for video that you have above is styling the class video, and you have an id of video in your html. In css you target an id with #, not a period. However it’s a better practice to style classes and not id’s.

    The video shortcode that you’re using creates a div with the class of .wp-video. You could just add margin: 0 auto to that class and that will center your video.

    .wp-video {
        margin: 0 auto;
    }

    Also another note, align is not a valid CSS property.

    Thread Starter woodstockblackfeather

    (@woodstockblackfeather)

    Thanks for all the help, I greatly appreciate it…

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Centering a video in WordPress’ is closed to new replies.