2

I want to change the Facebook embedded posts plugin to fit in the side bar widget for my site. Currently, it is 286px wide, but the Facebook plugin width is around 567px.

How can I accomplish that?

3 Answers 3

4

If you are using the Facebook Embedded Posts Plugin released at the beginning of August (2013), you cannot currently change the appearance or width of the post. According to the documentation (linked to above):

Can I customize how the post is displayed on my web page?

Currently, you cannot customize how Embedded Posts are displayed on your page. The size of the post is fixed to the same dimensions as it's shown on Facebook.

My unexpert two-cents: Theoretically, you could apply your own CSS to the <div class="fb-post"></div>, but it seems like (as of right now) this will just end up cutting off part of the post or messing up the aspect ratio (or something to that effect).

1
  • is right about cutting off part of the post. I've been working on this problem this morning, and there is a stubborn CSS selector I cannot override. The declaration is found here... fbstatic-a.akamaihd.net/rsrc.php/v2/ye/r/CLfnQ5_ZbfP.css ... and it looks like this: ._57p0 ._6ns { margin: 0; width: 552px; } I've used very a very specific selector in my CSS file to set the width to 250px, and not only does this not override the above, by my declaration doesn't even show up in Firebug as overwritten. (The latter fact suggests that I wrote my CSS markup wrong, but I can't for
    – Jeff Cohan
    Sep 10, 2013 at 16:36
0

css:

.fb-post iframe {
    transform:scale(0.5,0.5);}

however then it will be quite tinsy. Beyond the iframe you lose css control.

2
0

You will able to solve it by using DIV element:

<div id="PostOnPage" class="fb-post" data-href="<%= lblLinkURL.Text %>" 
            data-width="350" style="pointer-events: none; ">

but the smaller width that facebook accept is range between 350px - 750px.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.