1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

How to use CSS to position content OUTSIDE of an iframe

Discussion in 'CSS' started by hulkster, Oct 18, 2007.

  1. #1
    I didn't think this would be difficult, but after spending an hour or so looking around and trying stuff, I'll post here to see if any guru's can figure it out.

    My halloween webpage has two iframe's in it halfway down - basically one on the left side and one on the right side.

    I have some content inside of the right side iframe (the "popup last 20 rollover") that I would like to display on the far left of the browser. I'm thinking no problem, just use "position:absolute; left:0px;" ... but that positions it on the left side of the iframe, not the browser.

    I have tried various permutations (such as "fixed") but no difference. If I do a "left: -200px" the rollover is clipped ... even if I play around with z-index.


    So ... is there a way to use CSS on content *inside* of an iframe so that it ends up being positioned *outside* of the iframe.

    TIA! ;-)
     
    hulkster, Oct 18, 2007 IP
  2. Dan Schulz

    Dan Schulz Peon

    Messages:
    6,032
    Likes Received:
    436
    Best Answers:
    0
    Trophy Points:
    0
    #2
    No you cannot, since the iframe references external content that your stylesheet cannot reference. The stylesheet can reference the iframe, but not what's contained inside it.
     
    Dan Schulz, Oct 19, 2007 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,998
    Best Answers:
    253
    Trophy Points:
    515
    #3
    ... and content inside an iframe stays inside and iframe as it's basically an entirely separate window that just happens to be rendered inside the same page.

    My advice - ditch the iFrames, if you really need those two sections as separate files, combine them server side using a SSI/CGI like SHTML, PHP, ASP, Perl, etc. etc.
     
    deathshadow, Oct 19, 2007 IP
  4. Arnold9000

    Arnold9000 Peon

    Messages:
    241
    Likes Received:
    6
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Ask someone in the ajax section, as ajax is based on a hidden frame of the page acting as an intermediary or interceptor between your page and the server. This allows one to update only specific items on the page without an entire refresh So it's perfect for talking between I frames without seemingly refreshing the whole page.
     
    Arnold9000, Oct 19, 2007 IP
  5. hulkster

    hulkster Peon

    Messages:
    1,705
    Likes Received:
    93
    Best Answers:
    0
    Trophy Points:
    0
    #5
    OK - thanks for the info - just kinda needed to know this could not be done with CSS. So I just used Javascript to do a parent.document write from the iframe to the main page.
     
    hulkster, Oct 19, 2007 IP