• 0

Centering a iframe?


Question

I have kinda a noob question :(

I was wondering if anyone knows how to center a iframe. I know it's not simply <center></center>

This is what I'm trying to center:

&lt;iframe src="https://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FDreamevil%2F137421629629744%3Fv%3Dwall&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"&gt;&lt;/iframe&gt;

Link to comment
Share on other sites

6 answers to this question

Recommended Posts

  • 0

Just toss in margin: 0 auto; to the "style:".

Didn't do anything :o

I appreciate you're always here to help me with coding problems though <3

Link to comment
Share on other sites

  • 0

Stupid iframes! http://dev.icupcake.org/neowin/purify2.html

 &lt;html&gt;
&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;style type="text/css"&gt;
#container {
	border: none; 
	overflow: hidden; 
	width: 450px;
	height: 21px;
	margin: 0 auto;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

 &lt;div id="container"&gt;
&lt;iframe src="https://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FDreamevil%2F137421629629744%
3Fv%3Dwall&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;
amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0"allowTransparency="true"&gt;&lt;/iframe&gt;
  &lt;/div&gt;

&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

Link to comment
Share on other sites

  • 0

Try this

&lt;div style="margin: auto; width:450px; height:21px;"&gt;&lt;iframe src="https://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FDreamevil%2F137421629629744%
3Fv%3Dwall&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;
amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"&gt;&lt;/iframe&gt;&lt;/div&gt;

Edit: Oops Cupcakes to the rescue :p

Link to comment
Share on other sites

  • 0

Stupid iframes! http://dev.icupcake.org/neowin/purify2.html

 &lt;html&gt;

&lt;head&gt;
&lt;title&gt;&lt;/title&gt;
&lt;style type="text/css"&gt;
#container {
	border: none; 
	overflow: hidden; 
	width: 450px;
	height: 21px;
	margin: 0 auto;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;

 &lt;div id="container"&gt;
&lt;iframe src="https://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FDreamevil%2F137421629629744%
3Fv%3Dwall&amp;layout=button_count&amp;show_faces=true&amp;width=450&amp;action=like&amp;font=arial&amp;
amp;colorscheme=light&amp;height=21" scrolling="no" frameborder="0"allowTransparency="true"&gt;&lt;/iframe&gt;
  &lt;/div&gt;

&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

I love you. :blush:

Thank you so much!

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.