Is it possible to set a fluid width for Facebook's social plugins?

后端 未结 29 1501
粉色の甜心
粉色の甜心 2020-12-22 18:52

I\'m developing a site around the \"responsive design\" concept, but the facebook social plugins are static width and \"break\" the layout when it\'s re-sized.

Using

29条回答
  •  佛祖请我去吃肉
    2020-12-22 19:22

    For those who prefer using the HTML5 code for Facebook plugins like the Activity Feed or Like Box:

    /******* IPHONE PORTRAIT MODE (480px or less) *******/
    @media only screen and (min-width: 480px) and (max-width: 767px) {
        .fb_iframe_widget span[style], .fb_ltr[style] {
        width:420px !important;
        }
    }
    
    • Doesn't work with comments or percentage-based width; stick to the iframe code if you need pure fluidity.
    • H/T to Alan for the css-tricks link at the top of this page. (:

提交回复
热议问题