CSS Selectors for documents inside their own iframe

  • 1 Replies
  • 2165 Views
CSS Selectors for documents inside their own iframe
« on: March 23, 2016, 15:45:31 pm »
How would i write a simple selector (e.g. by class or Id) for an element that is nested inside an iframe ?

for example:

Code
<html>
<body>
....
<iframe src="/resources/demo/webdemo.html" class="demo-iframe">
    <!DOCTYPE html>
    <html lang="en">
        <head>
        </head>
        <body>
              <div id="example"></div>
        </body>
    </html>
</iframe>
....
</body>
</html>

How to select the div with the id "example" ?

Re: CSS Selectors for documents inside their own iframe
« Reply #1 on: April 07, 2016, 17:31:59 pm »
I don't think it is possible.

As far as CSS is concerned, it only applies searches to html root. and an iframe is located in another document and therefore not under html root

 

Sitemap 1 2 3 4 5 6 7 8