How to give style to iframed page content using pa

2019-02-19 01:22发布

How to style iframed page's content using parent pages css ? I don't have access of iframed page?

i made thisfor example - http://jsbin.com/uxobe

how to style differently HTML of the page which i'm using in iframe?

Is therey a way to style like this through css or js+css ?

http://siteurl { background:red}

2条回答
Ridiculous、
2楼-- · 2019-02-19 01:32

If you have no kind of access to the IFrame, neither from server side nor through JS because of cross domain issues: Not at all, I'm afraid.

If you can get hold of it through JS, you could sneak in own stylesheets one way or another, either by directly accessing and changing the styles (clean) or writing a <style> tag (not w3c valid).

查看更多
欢心
3楼-- · 2019-02-19 01:33

I was able to accomplish styling an object in the iframe src file by putting javascript in that file which looked for a query string value and did the styling (or not) based on the presence (or absence) of the query string. This approach requires having control over the iframe target file, and worked well for me. I am trying to display a scaled down version of my own website in an iframe appearing in another one of my sites.

查看更多
登录 后发表回答