0

So I'm trying, through whatever way possible, to modify the Facebook Like Box's CSS. I've found the offending value and I want to change it. This is inside of an iframe.

The CSS is this:

.pluginLikeboxStream {
overflow-x: hidden;
overflow-y: auto;
}

This is causing there to always be a scrollbar on the Like Box stream, which I really, really don't want.

I'm not seeing anyway to modify this - not the Javascript SDK (which is my best hope, I think), not through using Javascript or jQuery on it (as it creates an iframe, this is impossible, as far as I can tell - even though Firebug lets me change this).

Obviously the best solution would be to be able to set a style using CSS, but that also seems impossible.

Is there any way to fix this?

I've tried to load the iframe with no scrollbars, but that's just on the outside of the iframe - this is obviously internal.

All I want is for this class to be set to overflow: hidden;

Steven Matthews
  • 9,705
  • 45
  • 126
  • 232

4 Answers4

1

It is not possible to change the CSS of the official Facebook Like Box because it is an external iframe.

Read more in this duplicate.

Community
  • 1
  • 1
Tanner
  • 1,214
  • 3
  • 12
  • 16
0

Since the content you want to change via CSS is in an iframe, you can inject a style into the iframe. But as Vector said, know what you are getting yourself into.

Community
  • 1
  • 1
Steven Lambert
  • 5,571
  • 2
  • 29
  • 46
  • I'm not changing the style, I'm changing the location of where the scrollbar is, because it makes no sense in the location it's at. – Steven Matthews Aug 07 '13 at 19:37
  • Changing the position of the scrollbar is part of changing styles. CSS stands for Cascade Style Sheet. Anything in a .css file is considered element styles. – R Lacorne Aug 07 '13 at 20:20
0

You can create your own "Like" button - without like count (but you can fix this) and then use JS API to "like" URL's

Andreyco
  • 22,476
  • 5
  • 61
  • 65
0

If you set !important then it will over rule any other CSS applied to the element

.pluginLikeboxStream {
    overflow: hidden !important;
}

!important should only be used in circumstances like this.

EDITED

To apply it to the iFrame you need to use jQuery

$('iframe').load( function() {
    $('iframe').contents().find("head")
      .append($("<style type='text/css'>  .pluginLikeboxStream {overflow: hidden !important;} /style>"));
});

This is how i've always done it.

Steven Mercatante
  • 24,757
  • 9
  • 65
  • 109
Kevin Lynch
  • 24,427
  • 3
  • 36
  • 37