Dynamic Facebook Like button width OR show Like count even when there are 0 likes

孤人 提交于 2019-12-23 02:05:13

问题


I just recently implemented the FB Like button, Google +1 button, Digg and Tweet buttons on my review pages, see here:

http://www.datesphere.com/reviews/dating-sites/geek2geek/

However, because the Facebook Like button changes width depending on whether someone has ever clicked "like", the spacing between buttons is inconsistent. Is there some way to dynamically set the width of the element depending on whether there are any like, OR (and I'm guessing this is easier) just show the little count box with a "0" in it if there are 0 likes instead of hiding it so that the element is always the same width?

Thanks!


回答1:


Put the Facebook like button inside a div with a fixed width and then it should be constrained to that width.



来源:https://stackoverflow.com/questions/6379361/dynamic-facebook-like-button-width-or-show-like-count-even-when-there-are-0-like

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