How to Center a YouTube Video in WordPress

Would you like to set your YouTube videos at the center of your WordPress website? By default WordPress automatically align your video to the left, if its width is less than that of your article field. 

Here, I have shown a quick process that will take only a couple of seconds. Then you will find your YouTube videos at the center of the page. Let’s see. 

How to Center a YouTube Video in WordPress

To bring your YouTube video to the center, navigate to Appearance -> Customize -> Additional CSS. 

Now, enter the following code. 

.wp-block-embed-youtube {
margin:0 auto;
}

Hit the publish button at the top. You are all done. Now your youtube video will appear at the center. 

Conclusion

I hope this quick process helped you to bring your YouTube video to the center of your page. If you liked the post, then please share it with your friends. Don’t forget to share your thoughts in the comment section below. 

Leave a Comment

Your email address will not be published. Required fields are marked *