admin管理员组

文章数量:1310700

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

i made thisfor example -

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}

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./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}
Share Improve this question edited Dec 29, 2009 at 12:47 Jitendra Vyas asked Dec 26, 2009 at 6:04 Jitendra VyasJitendra Vyas 153k240 gold badges586 silver badges867 bronze badges
Add a ment  | 

2 Answers 2

Reset to default 7

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).

I was able to acplish 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.

本文标签: javascriptHow to give style to iframed page content using parent pages cssStack Overflow