• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2665

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Add Margin After Video in WordPress

This beginners tip provides a basic solution so you can add some space below your self hosted videos in WordPress.

If you’re embedding YouTube videos in WordPress, you shouldn’t have this problem:

no margin after video

And here’s what this solution does:

margin below video

To embed a self hosted video in your WordPress editor, you simply upload it to your Media Library and paste the full URL to the video on its own line in your Text editor like this:

no margin added tp video

To add a space between the bottom of your video and your text, simply wrap your video URL in a new div class like this:

video div

And then add your CSS to your child themes style.css file like this:

.video-margin {
    margin-bottom: 20px;
}

Maybe this is something that should be built into parent themes.

Pretty simply tip but one which won’t cause a problem if you remove the CSS and use another solution down the track like shortcodes will.

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems