Hiding elements within Iframe

Does anyone know how to hide elements within an iframe?

I have an iframe element that looks like this.

I would like to remove the <div id=“header-container”

the result should look like this then.


You can’t change the styles if that frame contains a page from another domain.
It’s a security feature that’s existed for ages.

not even if you use js to filter the generated html?

@Nyokhix, I’m unfamiliar with a reliable method to defeat CORS which is what needs to happen for this to work.

Can you share a link or some more information on this? I’d be interested to learn and have no problems saying “I stand corrected.” :wink:

Does this help in any way?

Thanks @KBConcepts, but unfortunately this will only hide the entire Iframe. It doesn’t do anything to the content inside the Iframe which would be a web page typically hosted on a different server.

Okay I’ll keep looking. Thanks for letting me know.