How to add an iframe around an embedded video

Transform business strategies with advanced india database management solutions.
Post Reply
Mostafa044
Posts: 679
Joined: Sat Dec 21, 2024 5:41 am

How to add an iframe around an embedded video

Post by Mostafa044 »

Do you want to add an iframe border around your video embed? Recently a user asked us for a way to add a border around their videos in WordPress. Since you can use both iframe and oEmbed to embed videos in WordPress, we will show you how to add an iframe border around an embedded video and how to add a border around oEmbed videos in WordPress.

IFRAME Border around WordPress Videovideo tutorialSubscribe to WPBeginnerIf you don't like the video or need further instructions, please read on.

Adding a border around iframe videos in WordPress
First, you need to open a post or page that contains the code to list of bahrain cell phone number embed your iframe video. A typical iframe embed code should look something like this:


Just change the border width and color and you're done.

While adding an iframe border works, there is a better way to add a border around videos in WordPress and that is by using oEmbed.

Adding a Frame Around oEmbed Videos in WordPress
WordPress has built-in oEmbed support. Basically, WordPress lets you paste the link of the video and it will automatically get the embed code for them. However, this only works for oEmbed enabled websites like YouTube, Vimeo, DailyMotion, Hulu, etc. (See: How to Easily Embed Videos in WordPress Using oEmbed )

Now that you know how to add a video using oEmbed, here's how to add a border around oEmbed videos in WordPress.

When adding a video with oEmbed, simply wrap the URL in a span tag with inline style parameters, like this:
Post Reply