2

How can I change the background to black of the soundcloud widget from http://psytology.com/artist/danny-xander/ ?

I have searched on Google, read the documentation, but this kind of widget doesn't work with the default parameter theme_color.

So I think, maybe I could rewrite the class that gives the background color to the player? So I added the following lines to style.css:

.g-background-default {
    background-color: rgb(36, 36, 36) !important;
}

(this being the class that gives color to the widget's background)

So, it didn't work, nothing happened, what can I do?

I have tried the second answer from this post, but it is not working. It doesn't display anything.

Community
  • 1
  • 1
  • Is the widget link in your question a sample of what you want, or is it the widget you want to modify? – user247702 Feb 12 '14 at 00:52
  • That is the widget I want to edit, the soundcloud player. I want change his CSS, so I can edit the background and the text color. (I want to make him dark) – Pavelescu Razvan Feb 12 '14 at 13:28

1 Answers1

2

The post you linked to in your edit DID say that it only works when its not cross-domain meaning if the iframe src is from another domain, you can't do it...

But the third post in that thread did mention an interesting concept. If you use the PHP function file_get_contents(); and get the iframe source, add the link to your style you need before the </head> and replace the iframe with your own PHP file, you may get it to work. He said he did it with Google Calendar.

https://stackoverflow.com/a/12521755/2748713 -- Link to the relevent post from the thread you found

Community
  • 1
  • 1
Ryan Ginnow
  • 83
  • 10
  • I said I have tried the second answer, and did not work. that is the second answer that is not working. I am working with flash, probably thats why. Google Calendar provides only html and css into that iframe, so thats why its working in that case. – Pavelescu Razvan Feb 12 '14 at 13:26
  • Still, being able to "inject" css styles into the iframe using javascript should work because the embedded SoundCloud isn't flash. – Ryan Ginnow Feb 16 '14 at 00:16
  • I know this is years old, but please accept if this helped you. – Ryan Ginnow Apr 13 '16 at 16:30