I just noticed today that the data-width attribute for the Facebook Like Box widget does not appear to be working. It looks like it is reverting to the default width. An example of what I'm talking about can be seen on http://blog.christopherjonesart.com.
Here is the code I'm using (it's pretty standard):
<div id="fb-root"></div>
<script>(function(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);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="fb-like-box" data-href="http://www.facebook.com/christopherjonescomicart" data-width="190" height="395" data-show-faces="true" data-border-color="black" data-stream="false" data-header="true"></div>
I am experiencing this issue on several websites. It is doing it in Chrome, Firefox, Safari and Internet Explorer. I have not recently updated Wordpress or made any changes to my css.
Help? It looks really crummy like this. :-(
Expanding on user2477225's answer, it might have problems with custom positioning that you set (relative or absolute somewhere on the page), so what I did was:
Seems to be working so far.
Edit: For IE 8 (and lower), please use this instead:
I like to be as specific as possible in my selectors, but after checking this issue some more, I see no technical reason to use the
>
selector here.According to Facebook official like box page, The minimum width is 292px.
Still, there is a little project on github to make facebook like box responsive and adapt to your website layout.
Applying this along with setting the width of the container to any width you prefer will force the facebook like box to fill that container and adapt to its width, no more, no less:
Simply Use
iFrame
instead offbml
and change width to whatever required.i.e.:(width:194px below)
Thanks!
After the fb:like-box add this script change the 244px to your width
Here is what I used to fix it, this is not the exact same since I don't show faces, but just adapt it to your code, the important part is the div #fb-like-container that I added, it lets me use css selectors to change required code.
CSS:
HTML (data-width is not taken into account):
I have face the same problem to you. my solution is use jquery script to change width of like box in the like box ready time.
in head section
and in document ready add
Cheers this must help you.