Facebook Like-Box min-width changed to 292px. Any way to change this behavior?

最后都变了- 提交于 2019-12-06 05:23:28

问题


I've just noticed a change in one of my websites html layout.

Everything looked messy and after searching i found out that the cause was that the Facebook Like Box (which min width seems to have changed to 292px) was insisde a 250px container.

https://developers.facebook.com/docs/reference/plugins/like-box/

I've had the like-box there for years widh a width=220px and it's kind of awckard that Facebook changed this "legacy" behavior. The box had its place on my site and now i need to figure out where to put it.

With my current website layout it's impossible to move the facebook like box in a different place; so i had to remove if for now.

Any ideas why Facebook did this and if there's any workaround?

Thanks,

Dan


回答1:


I don't know why Facebook has done it, but you can easily set your own width using CSS:

.fb-like-box span, .fb-like-box iframe {
    width: 220px !important;
}



回答2:


There is a data-width attribute of the div to manage the width.

The below code is working absolutely fine.

<div class="fb-like-box" data-width='260' data-href="https://www.facebook.com/FacebookDevelopers" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="true"></div>


来源:https://stackoverflow.com/questions/17093685/facebook-like-box-min-width-changed-to-292px-any-way-to-change-this-behavior

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!