WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Having trouble aligning a video (15 posts)

  1. trevormiltonwilson
    Member
    Posted 1 year ago #

    I am trying to embed a video for the first time. I have it showing OK but I would really like it to be centered. I've a done a search on here but the answers don't work (using div tags etc.). Can anybody help? The post is here: http://www.silverphotography.co.uk/wordpress/2013/01/favourite-wedding-photographs/

    I also tried to use shortcode [vimeo xxxxxxxx] but that didn't work either - do you have to use a plugin for the shortcode to work? I was hoping to use a shortcode so that I could specify the width to artificially center it.

    Any help would be appreciated!

  2. Andrew
    Forum Moderator
    Posted 1 year ago #

    Can you make sure you link the correct page?

  3. trevormiltonwilson
    Member
    Posted 1 year ago #

    It is correct but the page was private. It should be OK now.

  4. Andrew
    Forum Moderator
    Posted 1 year ago #

    Try the CSS;

    .entry-content iframe {
     display: table;
     margin: 0 auto;
    }
  5. trevormiltonwilson
    Member
    Posted 1 year ago #

    Thanks Andrew but can you tell me how I implement this code (where do I put it?)

  6. Andrew
    Forum Moderator
    Posted 1 year ago #

    Does that theme come with a visible section in the dashboard named something like, "Custom CSS", "Custom Styles" or "Jetpack"?

  7. trevormiltonwilson
    Member
    Posted 1 year ago #

    Yes - there is an area called 'custom css code' that already has the following code in it:

    p {
    margin-bottom:0.5em;
    }

    #footer {
    border-top:0 solid #E8E7E7;
    text-align:center;
    }

    Sorry for being a pain - CSS is something I have trouble understanding.

  8. Allen Moore
    Member
    Posted 1 year ago #

    Navigate to Theme Options >> Other Options > Custom CSS and add the css that @anevins provided.

  9. Allen Moore
    Member
    Posted 1 year ago #

    Trevor, just cut and paste the code that Andrew provided after
    #footer {
    border-top:0 solid #E8E7E7;
    text-align:center;
    }

  10. Andrew
    Forum Moderator
    Posted 1 year ago #

    In the Custom CSS Code section, at the bottom, enter it.
    E.g

    p {
    margin-bottom:0.5em;
    }
    
    #footer {
    border-top:0 solid #E8E7E7;
    text-align:center;
    }
    
    .entry-content iframe {
     display: table;
     margin: 0 auto;
    }
  11. trevormiltonwilson
    Member
    Posted 1 year ago #

    I've added your code and it works a treat - thanks so much!

    Does this only affect embedded videos?

  12. Andrew
    Forum Moderator
    Posted 1 year ago #

    No, I didn't differentiate between videos and anything that will appear in an iFrame HTML element.

  13. trevormiltonwilson
    Member
    Posted 1 year ago #

    So I gather that WP automatically adds an iFrame whenever I embed a video?

  14. Andrew
    Forum Moderator
    Posted 1 year ago #

    I don't know how your iFrame got in the page, sorry.

  15. trevormiltonwilson
    Member
    Posted 1 year ago #

    No worries! I certainly didn't add it do I guess WP must have done!

    Thanks again!

Topic Closed

This topic has been closed to new replies.

About this Topic