Tom Posted August 26, 2010 Share Posted August 26, 2010 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: <iframe src="https://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FDreamevil%2F137421629629744%3Fv%3Dwall&layout=button_count&show_faces=true&width=450&action=like&font=arial&colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe> Link to comment Share on other sites More sharing options...
0 Cupcakes Posted August 26, 2010 Share Posted August 26, 2010 Just toss in margin: 0 auto; to the "style:". Link to comment Share on other sites More sharing options...
0 Tom Posted August 26, 2010 Author Share Posted August 26, 2010 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 More sharing options...
0 Cupcakes Posted August 26, 2010 Share Posted August 26, 2010 Stupid iframes! http://dev.icupcake.org/neowin/purify2.html <html> <head> <title></title> <style type="text/css"> #container { border: none; overflow: hidden; width: 450px; height: 21px; margin: 0 auto; } </style> </head> <body> <div id="container"> <iframe src="https://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FDreamevil%2F137421629629744% 3Fv%3Dwall&layout=button_count&show_faces=true&width=450&action=like&font=arial& amp;colorscheme=light&height=21" scrolling="no" frameborder="0"allowTransparency="true"></iframe> </div> </div> </body> </html> Link to comment Share on other sites More sharing options...
0 RoomKid Posted August 26, 2010 Share Posted August 26, 2010 Try this <div style="margin: auto; width:450px; height:21px;"><iframe src="https://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FDreamevil%2F137421629629744% 3Fv%3Dwall&layout=button_count&show_faces=true&width=450&action=like&font=arial& amp;colorscheme=light&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe></div> Edit: Oops Cupcakes to the rescue :p Link to comment Share on other sites More sharing options...
0 Tom Posted August 26, 2010 Author Share Posted August 26, 2010 Stupid iframes! http://dev.icupcake.org/neowin/purify2.html <html> <head> <title></title> <style type="text/css"> #container { border: none; overflow: hidden; width: 450px; height: 21px; margin: 0 auto; } </style> </head> <body> <div id="container"> <iframe src="https://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fwww.facebook.com%2Fpages%2FDreamevil%2F137421629629744% 3Fv%3Dwall&layout=button_count&show_faces=true&width=450&action=like&font=arial& amp;colorscheme=light&height=21" scrolling="no" frameborder="0"allowTransparency="true"></iframe> </div> </div> </body> </html> I love you. :blush: Thank you so much! Link to comment Share on other sites More sharing options...
0 McCordRm Posted August 26, 2010 Share Posted August 26, 2010 lol So much love. Link to comment Share on other sites More sharing options...
Question
Tom
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:
Link to comment
Share on other sites
6 answers to this question
Recommended Posts