I'm developing a site around the "responsive design" concept, but the facebook social plugins are static width and "break" the layout when it's re-sized.
Using media queries, I've set the plugins to hide on low-res browsers (mobile, etc...). However, on desktop browsers, when the browser window is re-sized smaller, but not so small to hide the plugins, they break out of the layout.
Any way to set a fluid width for the Facebook social plugins?
Here is what I ended up with:
This is JQuery and might be part of the answer to your question. I am using the HTML5 version of the like button:
The "div.main-content" element is the element that the like button must fit into in my design. The resizing works until to the div gets so small that the data-layout attribute in the div.fb-like needs to be changed from "standard" to an alternative that takes up less horizontal space. I am new at this, so I am not sure if this is the most elegant solution to making the like button repsonsive. I would like to see an answer to this question from somebody that is more of an expert on this subject.
Just put this either in your CSS file or in your html code with style tags !!!
Ref: http://dwij.co.in/making-facebook-comments-responsive
I don't know about the comments, but with the link box, all you have to do is use the iframe option direct from Facebook and switch out the width in pixels with a percentage, and it'll change depending on the width of the column it's in.
An important note about this resize stuff: If the Facebook comment script detects that you're on a mobile device it breaks this. But, if you make the
<fb:comments>
tag contain the attribute valuemobile="false"
then (for now) Facebook's scripts will respect your CSS.If you are using the official wordpress facebook plugin due to the mobile sniffing facebook do.
You will need to change the facebook/social-plugins/fb-comments.php on line 35.
This will allow you to style with the below.
It would be nice if they could either fix their mobile version or put a setting on their plugins GUI.