How to apply style to a div which is inside an ifr

2019-08-04 00:25发布

问题:

This question already has an answer here:

  • How to apply CSS to iframe? 26 answers
  • style content within an iframe 3 answers

I have been working with css and html for about 6 months. I am confused: why can't I apply styles to a div which is inside an iframe of my current page?

回答1:

The inner page is independent when it comes to css styles. You can add styles to the iframe element itself, but if you want to style divs inside it, you would have to reference the css on the child page.



标签: css iframe