How can I control the background image and colour of a body element within an iframe
? Note, the embedded body element has a class, and the iframe
i
I have a blog and I had a lot of trouble finding out how to resize my embedded gist. Post manager only allows you to write text, place images and embed HTML code. Blog layout is responsive itself. It's built with Wix. However, embedded HTML is not. I read a lot about how it's impossible to resize components inside body of generated iFrames. So, here is my suggestion:
If you only have one component inside your iFrame, i.e. your gist, you can resize only the gist. Forget about the iFrame.
I had problems with viewport, specific layouts to different user agents and this is what solved my problem:
The logic is to set gist (or your component) css based on user agent. Make sure to identify your component first, before applying to query selector. Feel free to take a look how responsiveness is working.