Hiding elements within Iframe


#1

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.

HELP!!!


#2

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.


#3

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


#4

@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:


#5

Does this help in any way?


#6

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.


#7

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