View Full Version : DIV over IFRAME
Jerome
02-26-2003, 02: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
02-26-2003, 03: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
02-26-2003, 05: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
02-26-2003, 06: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
02-26-2003, 06: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
02-26-2003, 06:28 PM
yea, z-indexed iframes dont go back very far, if at all.
Jerome
02-26-2003, 07: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
02-26-2003, 08: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
02-26-2003, 08: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
02-26-2003, 10:54 PM
One can only z-index an iFRAME in IE5.5+.
You can always put the DIV on top of the iFRAME...
Jerome
02-27-2003, 10:37 AM
Thanks for your given time gentlemen,
I need to find another solution to show the text over an iframe.
Jerome
chrismiceli
02-27-2003, 12: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.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.