How can I make the Facebook Like button's width automatically resize?

后端 未结 8 1095
清酒与你
清酒与你 2020-12-13 13:53

I\'m implementing the Facebook Like Button, but I\'m running into some trouble with the width. I\'m using the JavaScript SDK implementation, not the direct iframe.

A

相关标签:
8条回答
  • 2020-12-13 14:54

    I'm personally using the following...

    #fbook-like {
        width: 50px !important; /*width of just the button*/
        overflow: visible; /*so there is no cut off*/
        vertical-align: top; /*bc all other like buttons align top*/
    }
    

    What I've done here is put the fb button on the far right and so it aligns with my edge, and just the comments added (dynamic in width) will show past the edge. I'm able to keep a good design while getting the comments showing, regardless of the length.

    0 讨论(0)
  • 2020-12-13 14:56

    I added this to my CSS:

    div.fb-like.fb_iframe_widget > span {
     width: 100% !important;
    }
    
    div.fb-like.fb_iframe_widget{
     width: 100%;
    }
    
    0 讨论(0)
提交回复
热议问题