British Inside

An Englishman living in small town America

James Shaw

News

  • Copyright James Shaw 2004-2007

    Creative Commons License

    View James Shaw's profile on LinkedIn

Facebook Like Button Bug

I added a facebook like button to a few sites last night, and then noticed something curious - big horizontal scroll bars that weren't there before. 

It turns out that the Facebook javascript inserts some buggy code into the fb-root div - it creates an off-screen div that is 575 pixels wide, and absolute positions it only in y.  It says top:-10000, but there is no left position. The end result is that if you put your Like button on the right side of your website, you'll get scroll bars because of this hidden div.

Dumb, right?

So, here's a simple fix that works in all the browsers I've tried so far (but CSS guru's please let me know if it should be improved):

In your stylesheet, add this:

#fb-root > div { left:0 } 

Posted: Thursday, July 07, 2011 6:48 PM by James
Filed under: ,
New Comments to this post are disabled