Log in

View Full Version : how center iFrame Facebook "LIKE"



tbk9901
08-15-2011, 02:26 AM
Hi, I've searched and searched for answer but whatever I found didn't work.

I'm trying to figure out how to center an iframe that uses the Facebook "like" icon and count no. No matter what I do it stays flush left.

Specifically I want the "Like" icon and count no. to center under "For Facebook Members:"

Here is the coding:

For Facebook members:<br />
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.frankfordfriendsschool.org&amp;send=false&amp;layout=button_count&amp;width=145&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:150px; height:21px; allowTransparency="true"></iframe>


Attached is what it looks like now:

jscheuer1
08-15-2011, 07:41 AM
You can center the iframe easily enough. But you cannot center the content of the iframe within the iframe. But you may not need to. If not, here's what I suggest:


For Facebook members:
<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.frankfordfriendsschool.org&amp;send=false&amp;layout=button_count&amp;width=145&amp;show_faces=true&amp;action=like&amp;colorscheme=light&amp;font&amp;height=21" scrolling="no" frameborder="0" style="display:block; margin: 0 auto; border:none; overflow:hidden; width:150px; height:21px;" allowTransparency="true"></iframe>

Note: For IE - Requires standards invoking DOCTYPE.

But HTML and css depend upon the other code for the page. So, if you want more help:

Please post a link to a page on your site that contains the problematic code so we can check it out.

tbk9901
08-19-2011, 02:40 AM
I like that much better!

Here is my web page:
http://www.frankfordfriendsschool.org/indextest3.html

Is my coding okay ... regarding DOCTYPE and IE?

jscheuer1
08-19-2011, 04:11 AM
Yes it is.

tbk9901
08-20-2011, 04:23 PM
Thank you very much for your help!
:D