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.

Overlay DIV over an iframe ?

Discussion in 'CSS' started by redhits, May 5, 2008.

  1. #1
    Can i have an overlay DIV over an iframe?!
    SEMrush
     
    redhits, May 5, 2008 IP
    sizzler_chetan likes this.
    SEMrush
  2. Greg-J

    Greg-J I humbly return to you.

    Messages:
    1,844
    Likes Received:
    153
    Best Answers:
    0
    Trophy Points:
    135
    #2
    To my knowledge, no you cannot. I would love to be proved wrong though.
     
    Greg-J, May 6, 2008 IP
  3. rpjs

    rpjs Peon

    Messages:
    39
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I believe it can be done, you just need to use the 'Position' property and specify where the div will be located using 'Top and Left'

    Example
    
    .overlay {
      position:absolute;
      top:200px;
      left:100px;
    }
    
    <div class="overlay">What ever goes here?</div>
    
    Code (markup):
    I have tried this and it does work in ie and ff
     
    rpjs, May 11, 2008 IP
  4. Greg-J

    Greg-J I humbly return to you.

    Messages:
    1,844
    Likes Received:
    153
    Best Answers:
    0
    Trophy Points:
    135
    #4
    z-index'es (which you'll need to set) on iframe's don't go back past IE 5.5. It depends on how compatible you want your site I suppose.
     
    Greg-J, May 11, 2008 IP
  5. blueparukia

    blueparukia Well-Known Member

    Messages:
    1,562
    Likes Received:
    71
    Best Answers:
    7
    Trophy Points:
    160
    #5
    You shouldn't need to use z-indexes for this, so long as you are not absolutely positioning the iframe as well.
     
    blueparukia, May 11, 2008 IP
  6. Greg-J

    Greg-J I humbly return to you.

    Messages:
    1,844
    Likes Received:
    153
    Best Answers:
    0
    Trophy Points:
    135
    #6
    I seem to remember running into an issue when trying to do this myself. I'm not 100% sure, but there's something about this that's very familiar and I think there was an issue I couldn't overcome when placing an element on top of an iframe.

    Hopefully our resident guru kk5st can chime in.
     
    Greg-J, May 12, 2008 IP
  7. Stomme poes

    Stomme poes Peon

    Messages:
    3,195
    Likes Received:
    136
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Gary, helloooo? Busy enjoying that SS income... fishing or something.

    Yeah, would be nice, but so far I agree with Greg, at least in IE you cannot position anything, even with a z-index of a bajillion, over an iFrame for the same reason you cannot get things on top of form controls, or Flash. The iFrame since IE5 and Flash (I think) get started on a whole other "layer"... like another page over the original page. So the bottom page (with all the rest of the HTML) can never get higher.

    I would think that in the smarter browsers, zoals FF, Opera, and Saffy, you CAN set a div (with a z-index of a bajillion) over an iFrame, but I don't work with the things so don't quote me on it... but with IE, you'd need another iFrame with this div instead.
     
    Stomme poes, May 13, 2008 IP
  8. almir

    almir Peon

    Messages:
    1,104
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #8
    YOu can do it over flash adding wmode="transparent" to flash code, but I can't make it over iframe too.
     
    almir, May 25, 2009 IP
  9. almir

    almir Peon

    Messages:
    1,104
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #9
    shit, I thought the thread date was May 13th 2009 :)
     
    almir, May 25, 2009 IP