css - Right-align the contents of a Facebook like-button iFrame? -


i need right align contents of facebook button sit against ride side of set "width". can in firebug setting table float: right;, doesn't appear work if define value in css.

here's in image explain question: enter image description here

edit: here's jsfiddle: http://jsfiddle.net/h66z3/2/

since using button_count layout, there little trick found seems work. wait iframe inserted, , set width 0. automatically resize proper size. can't swear works under circumstances , widths, please test out , see if works you. here sample code page:

<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <script type='text/javascript'> function loadcode(d, s, id) {   var js, fjs = d.getelementsbytagname(s)[0];   if (d.getelementbyid(id)) {return;}   js = d.createelement(s); js.id = id;   js.src = "//connect.facebook.net/en_us/all.js#xfbml=1";   fjs.parentnode.insertbefore(js, fjs); } function init() { loadcode(document, 'script', 'facebook-jssdk'); settimeout(initx, 10); } function initx() { likeframe=document.getelementbyid('d2').getelementsbytagname('iframe')[0]; if (likeframe) settimeout(setwidth, 10); else settimeout(initx, 10); } function setwidth() { likeframe=document.getelementbyid('d2').getelementsbytagname('iframe')[0]; likeframe.style.width='0'; } </script> </head> <body onload='init()' style='margin:10px 50px'> <div id="fb-root"></div> <div style='text-align:right'>here right-aligned text compare to.</div> <div id='d2' style='float:right'> <div class="fb-like" href="http://www.google.com" data-send="false" data-layout="button_count" data-width="90" data-show-faces="false"></div> </div> </body> </html> 

unfortunately doesn't work standard layout, not sure why it's different.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -