Ads By Google

How To Add A Frame Around YouTube Videos In WordPress

Framing YouTube Videos

Something I did out of boredom today. Saw lots of blogs embedding their Youtube videos in the same boring style, so I thought it would be nice if we were to add a nice frame around those videos. First I downloaded an image of a picture frame and re-sized it to fit my content area. Then made provisions in the center of that image to fit the default YouTube Video size which in this case is the medium size of 425 x 344.

Created a new ‘div class’ called “vidframe” in my style sheet. Set all the attributes to display and position the video exactly in the center of the image. When I want to “frame” my Videos all I have to do is to wrap the embed codes between the new class I have created. Like this:
<span class="vidframe">All Your YouTube embed codes here</span>

Must say I am quite happy with the result. There are limitations though. You can only embed videos in one size. Anything other than that, you will need to make a new image and create another class in your stylesheet. Maybe on another boring day, I’ll create another one to fit the wide screen videos that are gaining popularity in YouTube.

To create one yourself, just just add a new class in your stylesheet, call it anything you want, make it to display as ‘block’, specify your width and height, text-align: center (important) then add paddings to the top to make the videos sit exactly inside the frame image. My codes looks like this. Your values will definitely be different.

.vidframe {display: block; width:520; height: 440px; text-align: center; background: url(images/vidframe.jpg) no-repeat; padding: 32px 0 0 0; }

The final result.

Share This Post
Ads By Google
 

Free Updates

Subscribe to receive Free WordPress Theme Tips, Reviews and Discount Codes

Related WordPress Theme Tips

How To Align YouTube Videos In WordPress PostUnder normal circumstances, when we want to align images, WordPress will give us the options when we upload the particular image. On the other hand, if the image source is...

How To Embed YouTube Videos In GmailJust read that we can now embed YouTube Videos in Gmail. Real Cool Man! Share This Post...

Embedding Videos In your WordPress Blog – for noobs.I remembered when I first started blogging in WordPress after spending a year with Blogger, the task of embedding a Video in my post was so daunting. It was still...

How To Frame And Stack Your Blog ImageSpent the whole of yesterday making a new WordPress Theme for myself. Had lots of fun learning many new codes and two of those are ones that we seldom use...

New Video Embed feature In WordPress 2.9Just a short post to test out the new video embedding feature included in WoprdPress 2.9. In case you have not been reading up on the latest features, WordPress 2.9...

Those who found this page were searching for:

  1. how to add padding below embedded video wordPress
  2. how to add a frame in video blog
  3. wordpress border on embed video
  4. youtube frame style
  5. add frame around youtube embed
  6. add border to vieo in wordpress
  7. how to create background video frame
  8. embed youtbue video box around wordpress
  9. adding a youtube video in frame?
  10. Liz Hobbs Group

One Response to “How To Add A Frame Around YouTube Videos In WordPress”

Read below or add a comment...

Trackbacks

  1. [...] This post was mentioned on Twitter by Lester Findley, Costa. Costa said: Latest update from Blogigs.com – How To Add A Frame Around YouTube Videos In WordPress Read all of it here http://bit.ly/13zr5w [...]