grmdgs
grmdgs

Reputation: 585

Hiding border inside iframe

I added the YouTube subscribe button:

<iframe src="http://www.youtube.com/subscribe_widget?p=XYZ" 
   style="overflow: hidden; height: 105px; width: 300px; border: 0;" 
   scrolling="no" frameBorder="0">
</iframe>

This site has a live example

The iframe contains a border which I would like to remove. The only way I have had success is to create a div for each side and mask the border. Is there another solution?

Upvotes: 0

Views: 1393

Answers (1)

Scott Hillson
Scott Hillson

Reputation: 853

You can throw that iframe into a container and hide the overflow of said container, this will prove a simple way for you to hide the borders:

​.container{height:100px;width:295px;overflow:hidden;}
iframe{position:relative;left:-2px;top:-2px;}

​ proof of concept: http://jsfiddle.net/hillsons/3KYp9/

Upvotes: 2

Related Questions