• Resolved UrsulaD

    (@ursulad)


    Hi guys,

    I am trying to center my you tube video and have used this code. <div style=”text-align: center;”><iframe width=”640″ height=”480″ src=”https://www.youtube.com/embed/HbK-LHXsxg8&#8243; frameborder=”0″ allowfullscreen></iframe></div>
    It aligns to centre on the backend but once I upload the site it shows to the left.
    This is the page I am talking about https://www.foodandbeveragetrainer.com/guest-service/.
    I am not sure if it has anything to do with another page I have css code for placing 2 videos side by side. I need that for one page and then I need on another page for the video to be in the centre.

Viewing 10 replies - 16 through 25 (of 25 total)
  • Thread Starter UrsulaD

    (@ursulad)

    I just tried it but still wont move to the center ??
    With the code <div class=”ytvid-container> where do I close the “.
    I tried with <div class=”ytvids”-container>

    <div class="ytvid-container">
     <div class="ytvids ytvids1">
     ---your code ---
     </div>
     <div class="ytvids ytvids2">
     ---your code ---
     </div>
     <div class="ytvids ytvids3">
     ---your code ---
     </div>
    </div>

    My fault, sorry.

    Thread Starter UrsulaD

    (@ursulad)

    it still wont move.

    I have this in the CSS. Do you think its affecting i? Should I remove or edit?

    .ytvids1 {
    clear: left;
    }
    .ytvids2 {
    clear: center;
    }
    .ytvids3 {
    clear: right;
    }

    And to center:

    .ytvids-container {
        margin-left: 10%; /* Adjust if necessary */
    }

    Yes, remove the other code.

    AAAgh did it again!

    .ytvid-container {
        margin-left: 10%; /* Adjust if necessary */
    }
    Thread Starter UrsulaD

    (@ursulad)

    I removed the code in css and replaced it with .ytvid-container {
    margin-left: 10%; /* Adjust if necessary */
    }
    but its still not moving to the center I must be doing something wrong but I have followed the steps you gave me ??

    Thread Starter UrsulaD

    (@ursulad)

    Yeah it finally worked.

    I removed “s” in all “vids” to “vid”.

    Thanks so much.
    So happy its done.

    Looks good ??

    Thread Starter UrsulaD

    (@ursulad)

    You saved me from tearing my hair out LOL.
    Its the 1st time to work with wordpress as was using vistaprint before.
    I was so restricted w them and so much happier with wordpress and all the learning and developing that comes with it.

Viewing 10 replies - 16 through 25 (of 25 total)
  • The topic ‘I cant center my you tube video’ is closed to new replies.