1

I have seen questions here about changing the CSS of iframe content from a parent site/page. However, i want the child page to detect if it is in an iframe and then change the CSS.

Thus this should be in the embedded page:

iframe body{color: red;}

This doesn't work. Is there a way to make it work or do I need to use JavaScript?

gre_gor
6,65412 gold badges103 silver badges105 bronze badges
asked Apr 19, 2020 at 17:54
2

1 Answer 1

-2

You should apply CSS to the iframe tag.
Like:

iframe {
 color: red;
}

This will work as expected.

answered Apr 19, 2020 at 18:06
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.