PDA

View Full Version : DIV over IFRAME



Jerome
Feb 26th, 2003, 03:02 PM
Hi,

Q: Is there a possibillity or work around to display a text (in a DIV) over an iframe?

R: >= IE 5.0

C:
<html>

<head>

</head>


<style>
#d1{
position:absolute;
top:50px;
left:50px;
height:30px;
width:200px;
background:transparent;
font-family:sans-serif;
font-weight:bold;
font-size:15px;
color:red;
}
</style>


<body>
<div id="d1">This text needs to be visible over the iframe</div>
<iframe src="http://www.google.com" name="gogle" width="300" height="300"></iframe>

</body>

</html>

T: Jerome

cg9com
Feb 26th, 2003, 04:16 PM
you need a z axis ;)
give the div a z-index higher than the z-index in your iframe, im pretty sure you can z-index iframes in new browsers.

iframe {
z-index:1;
}
.mydiv {
z-index:2;
}

Jerome
Feb 26th, 2003, 06:34 PM
Hi cg9com,

Unfortunately it's not working....

In IE 6.0 it should be working, however, I need a solution starting at IE 5.0

Isn't their an idea with layers which might work?
I can place the text within any TAG, but it must be text and no image.

Thanks in advance,
Jerome

cg9com
Feb 26th, 2003, 07:13 PM
funny, i thought i heard that iframes could be z-indexed now
or maybe its IE being IE :rolleyes: could you post your CSS?
anywho layers are made with the z-index, unless of course you are talking about the actual <layer> element which isnt supported in IE at all, NS only.

Jerome
Feb 26th, 2003, 07:24 PM
See the code in the question, no separate style-sheet, the only thing you need to add is what you wrote:

iframe { z-index:1; }
.d1{ z-index:2; }

I'am using IE 5.0 and it's not working,
Jerome

cg9com
Feb 26th, 2003, 07:28 PM
yea, z-indexed iframes dont go back very far, if at all.

Jerome
Feb 26th, 2003, 08:52 PM
Still, there need to be a way to do it.

In my opinion you will find at www.twinhelix.com an iframe with on the top of the page a div (with there logo) over the iframe.

Or is this effect done else?

Thanks,
Jerome

cg9com
Feb 26th, 2003, 09:18 PM
aaah this is done with dhtml, or in other words, lots of javascript.
no, thats not an iframe

thats a pretty sweet site 2 by the way, heh.

Jerome
Feb 26th, 2003, 09:27 PM
Hi,

Sorry, I looked wrong the iframe works as a buffer for downloading the files displayed in a mainDIV.

Over this mainDIV is another DIV placed .

So DIV over DIV and not DIV over IFRAME.

To bad for me.......

Jerome

Quiet Storm
Feb 26th, 2003, 11:54 PM
One can only z-index an iFRAME in IE5.5+.

You can always put the DIV on top of the iFRAME...

Jerome
Feb 27th, 2003, 11:37 AM
Thanks for your given time gentlemen,

I need to find another solution to show the text over an iframe.

Jerome

chrismiceli
Feb 27th, 2003, 01:56 PM
there is another post on this forums talking about how an iframe is like a scrolling div, if you could make the div like an iframe, then you could give it any z-index you wanted. just my thoughts on the subject.