How to make YouTube embedded videos align to center

Written by cristina puno
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to make YouTube embedded videos align to center
Embedded videos can be aligned using style elements. (Hemera Technologies/AbleStock.com/Getty Images)

When sharing media on your blog or your own website, the easiest method is to use the embed code provided by streaming media sites such as YouTube. You can define the look of your embedded YouTube video using the options provided on YouTube.com. Elements such as the size and video quality can be set up there, although when it comes to posting the video on your site, you will need to manually define its position and alignment.

Skill level:
Easy

Other People Are Reading

Instructions

  1. 1

    Open the Web page where you want to embed the YouTube video, using an HTML editor or Notepad.

  2. 2

    Type in the following code:

    <div style="text-align:centre;">YouTube Embed Code</div>

    Replace "YouTube Embed Code" with your own YouTube embed code.

  3. 3

    Save the file. Your embedded YouTube video will now be aligned to centre.

Tips and warnings

  • If you have an external CSS file, you can add a DIV class for use on embedded videos. Add the following CSS code:
  • .youtube {text-align:centre;}
  • To use it, just define a class for your DIV tag:
  • Embed code here

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.