Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to set a fluid width for Facebook's social plugins?

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?

like image 273
Chaddeus Avatar asked Jun 28 '11 00:06

Chaddeus


People also ask

How do I use Facebook plugins?

You can show your cover photo, posts, and friend's faces in the page plugin. Once you are satisfied with the appearance, click on the Get Code button to continue. Facebook will now show you two code snippets. Copy the first code snippet and paste it in your theme or child theme's header.

What are Facebook plugins?

Social plugins, like the Like button, the Share button and comments, are tools that let you share your experiences on other websites with your friends on Facebook. Social plugins include: Like button; Tap Like to share and connect with things from other websites that you find interesting.

How do you get an iframe page on Facebook?

You can programatically convert any fb page url into the url fb allows you to insert into an iframe. Check their docs for more info. For fb pages it works perfectly.


2 Answers

none of these methods worked but using this idea, the following worked for me:

.fb-comments, .fb-comments span, .fb-comments.fb_iframe_widget span iframe {     width: 100% !important; } 
like image 123
Jubair Avatar answered Sep 20 '22 17:09

Jubair


I found a solution using css. Inspiration came from this article http://css-tricks.com/2708-override-inline-styles-with-css/

.fb-comments, .fb-comments iframe[style] {width: 100% !important;} 
like image 39
Alan Avatar answered Sep 21 '22 17:09

Alan