Plugin Author
Eirudo
(@eirudo)
Hello, you can add custom CSS to your Theme
(Appearance > Customize > Additional CSS)
or custom CSS section in Theme Options of your current theme (if available)
Insert this code:
.erd-youtube-responsive {
margin-bottom: 25px !important;
}
Change 25px to any value you want.
If you also want to add space top of the video, you can specify margin-top. Example:
.erd-youtube-responsive {
margin-top: 25px !important;
margin-bottom: 25px !important;
}
Let me know if it works π
-
This reply was modified 5 years, 6 months ago by
Eirudo.
-
This reply was modified 5 years, 6 months ago by
Eirudo.
Thank you! I will try it π
Do you know why this happens? Is it normal? When I add the normal Youtube embed code I get a line break automatically, but when I use your plugin or use css code like this to make video responsive there is no line break:
.video-container {
overflow: hidden;
position: relative;
width:100%;
margin-bottom:12px;
}
.video-container::after {
padding-top: 56.25%;
display: block;
content: '';
}
.video-container iframe {
position: absolute;
width: 100%;
height: 100%;
}
Plugin Author
Eirudo
(@eirudo)
Don’t worry, it’s very normal π
Because I’m not adding spaces or margin on the video by default.
I consider this because most people using text editor on their WordPress Post (which WordPress added line-breaks automatically).
Even you add that custom CSS, will not affect youtube video on this plugin because it’s using different CSS classes.
But, you can using code I provide above.
And… Thank you for using this plugin ^_^
Thank you for your kind help. However, I am using text editor too, the classic editor, but it is not adding automatic line break when I add a video. Is Youtube adding space/margin by default with css on their side? Just trying to understand if something is wrong with my site.
Plugin Author
Eirudo
(@eirudo)
By default, original YouTube code not adding any break spaces/margin.
So, it’s will follow CSS rules on the theme…
But for this plugin, I set it to 0px so there’s no break spaces and follow WordPress rule (automatically adding break spaces).
If your post not showing break spaces, it might your theme has a function which remove WordPress break-spaces rule on each post.
Wordpress auto break-spaces really annoying sometimes…
But most people really need it since don’t want adding <br> codes manually.
I fixed it! I had set a class to 0px instead of 20px in my theme. Sorry for the trouble.
Plugin Author
Eirudo
(@eirudo)
Glad to know if the issues has been fixed π
No probem, I’ll help if there’s any trouble about this plugin π
Thank you for using Simple YouTube Responsive!
Have a nice day…