Grow your CSS skills. Land your dream job.

Help: Override iframe’s content CSS

  • # June 26, 2009 at 4:30 pm

    I’ve googled a lot for it with no success.

    I have a page "A", that contains a iframe "B".
    Can i overrride the CSS of the iframe "B" with the CSS from the container page "A"?

    I’m pretty sure that i can be done with a little bit os JS, but how?

    # June 26, 2009 at 6:40 pm

    I’m pretty sure that it can’t be done. It’s a security thing. Think if someone created a website that was just one big giant iframe of your website, only changed the CSS to look a little different. Problematic.

    # July 4, 2009 at 4:39 pm

    Yeah, the security issue makes sense.
    I’m quetioning cuz in my job we use an web based software to manage "bluetooth hotspots" . (Sounds Strange but it works)

    This software have a (very poor) api, that works via http post and get functions, and reply only as a white page with all the response lines in a <pre> tag. So i did a little test ( only to show for my boss that the API sucks) creating a page with form that targets itself, and echo the values inputed into the src of a iframe, so it loads those ugly logs without changing the page.

    My intent was only make the iframe black* and the characters green. (Console-like got it?)

    * got the black iframe setting allowtransparency="true" and putting it into a blck <div>, but the font color was black to, sice is the default color on <pre> tags. :(

    Anyway, thanks for the reply Chris.

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".