Set CSS for iframe from third party site

2019-06-22 08:25发布

问题:

I am trying to style the snapwidget instagram feed, I want to make the border white. This is not a setting of the widget so I tried adding css. It seems that my css is not being detected since the content is in an iframe. Is there a way to force my css on the iframe content?

回答1:

It won't work unless the iframe is on the same domain due to same origin policy. http://javascript.info/tutorial/same-origin-security-policy

Check out Using CSS to affect div style inside iframe for an explanation



标签: css iframe