Centering youtube videos on chrome and firefox

Discussion in 'HTML & Website Design' started by cscott5288, Oct 26, 2009.

  1. #1
    How do you center the embedded youtube video code in firefox and chrome? Nothing I try seems to work. I tried using align for object, I tried throwing the object into a div that is centered.

    Thanks
     
    cscott5288, Oct 26, 2009 IP
  2. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #2
    On line 32 of your markup, delete that line.
     
    drhowarddrfine, Oct 26, 2009 IP
  3. cscott5288

    cscott5288 Active Member

    Messages:
    912
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #3
    What markeup are you talking about? I didn't give you a URL ...
     
    cscott5288, Oct 27, 2009 IP
  4. MhW

    MhW Active Member

    Messages:
    370
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    85
    #4
    Put it in it's own container:

    HTML
    <div class="youtube-video">*youtube code here*</div>
    Code (markup):
    CSS:
    .youtube-video {width: 430px; margin: 0 auto;}
    Code (markup):
    Should work :)
     
    MhW, Oct 27, 2009 IP
    cscott5288 likes this.
  5. drhowarddrfine

    drhowarddrfine Peon

    Messages:
    5,428
    Likes Received:
    95
    Best Answers:
    7
    Trophy Points:
    0
    #5
    My point, exactly.
     
    drhowarddrfine, Oct 27, 2009 IP
    MhW likes this.
  6. CannonLogin

    CannonLogin Peon

    Messages:
    311
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #6
    That made me laugh, lol.

    Back on topic, depending on how your layout is you might not have to do it the way MhW suggested. Also if you aren't familiar with css. You could always go with the outdated <center></center> tags.
     
    CannonLogin, Oct 28, 2009 IP
  7. cscott5288

    cscott5288 Active Member

    Messages:
    912
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #7
    I don't get the joke ... line 32 of what? the embedded youtube code?

    It worked fine with CSS, thanks.
     
    cscott5288, Oct 28, 2009 IP
  8. MhW

    MhW Active Member

    Messages:
    370
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    85
    #8
    No problem :)

    FYI, the point drhowarddrfine was trying to make is that you didn't post a link to where you were having the problem, you didn't even post any HTML / CSS. It can be frustrating when somebody asks for help and doesn't give any decent information.

    Help us, help you ;)
     
    MhW, Oct 28, 2009 IP
  9. cscott5288

    cscott5288 Active Member

    Messages:
    912
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    60
    #9
    Oh, I figured a solution would be fairly generic considering embedded youtube videos are a common thing, but I guess I should have posted a url.

    Thanks anyway!
     
    cscott5288, Oct 28, 2009 IP