Results 1 to 3 of 3

Thread: Div on top of Iframe?

  1. #1
    Join Date
    Jul 2007
    Location
    England
    Posts
    41
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Question Div on top of Iframe?

    I have a page with 2 divs on it. Inside one of these divs is an iframe.

    Now, i want to add another div to the page, but have it show on top of the iframe.

    I've tried using z-index, but all that does is make the div appear on top of the other div (the one without the iframe in it).

    I can't for the life of me make a div show ON TOP OF an iframe. It must be possible...

    Code:
    <html>
    
    <body>
    
    <div id="1">
    <iframe id="navbar_act" src="../navbar.htm" scrolling="no" border="0" frameborder="0">
    Your browser does not support inline frames or is currently configured not to display inline frames.</iframe>
    </div>
    
    <div id="2">
    Blah blah blah
    </div>
    
    <div id="3">
    Help me!
    </div>
    
    </body>
    
    </html>
    Note: I'm using CSS for positioning, etc- hence the lack of here.

    As you can see, the iframe is in div 1, and I need div 3 to be on top of that iframe.

    Any help please?

  2. #2
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    Did you try moving the iframe's z-index?
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    We could really use more information here, like just what CSS you are using. A link to your page that shows this problem would be best.

    However, here is a very simple example:

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    div {
    position:absolute;
    top:30px;
    }
    #d2 {
    top:190px;
    }
    </style>
    </head>
    <body>
    <div id="d1">
    <iframe id="navbar_act" src="about:blank" scrolling="no" frameborder="1">
    Your browser does not support inline frames or is currently configured not to display inline frames.</iframe>
    </div>
    
    <div id="d2">
    Blah blah blah
    </div>
    
    <div id="d3">
    Help me!
    </div>
    
    </body>
    </html>
    Last edited by jscheuer1; 02-25-2008 at 10:50 AM. Reason: add example
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •