Jitendra Vyas
Jitendra Vyas

Reputation: 152825

How to give style to iframed page content using parent pages css?

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}

Upvotes: 4

Views: 13004

Answers (2)

MalamuteMan
MalamuteMan

Reputation: 171

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.

Upvotes: -2

Pekka
Pekka

Reputation: 449783

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

Upvotes: 7

Related Questions