开发者

How can I remove the 'people like this' message next to facebook like button? [duplicate]

This question already has answers here: Closed 10 years ago.

Possible Duplicate:

Facebook Like-Button - hide count?

I created a facebook like button using their Open Graph protocol.

Everything works well, except I w开发者_JS百科ould like to remove the message next to the Like button that reads

"Name and Name both like this."

The class for that div is 'connect_confirmation_cell'. I tried setting display:none on that div but it doesn't work. Any Ideas?


The answer that worked for me was found here: https://stackoverflow.com/a/6326964/562635

I'm using the XFBML button. This will hide the like count but not hide the facebook comment widget that immediately displays after liking a page.

/* make the like button smaller */
.fb_edge_widget_with_comment iframe
{
    width:47px !important;
}

/* but make the span that holds the comment box larger */
span.fb_edge_comment_widget.fb_iframe_widget iframe
{
    width:401px !important;
}


Both the iframe and FBML versions of the Like button use an iframe to display the actual button and associated text, so any CSS styles you try to apply will not work.

If you were using the iframe version of the Like button, you could use a CSS style to limit its dimensions to exclude this text while still displaying the actual button. The "zeckdude and Martey like this" text would still be displayed, but not be visible to the user.


HTMLS:

(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'));

layout="box_count" removes the "name and name likes this".


this worked for me:

.fb-like.fb_edge_widget_with_comment.fb_iframe_widget {
    height: 26px;
    overflow: hidden;
    width: 138px;
}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜