Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Absolute positioning over iframe in Opera

Status
Not open for further replies.

minli98

IS-IT--Management
Aug 30, 2005
178
US
Hi,

I would like to draw an absolute div that overlaps with an iframe.

Code:
<div style="position:absolute;width:100px;height:100px;border:solid 1px;z-index:100;">
	This is a div
</div>

<iframe height="300" width="300" style="margin-top:50px" frameborder="1">
</iframe>

In both Firefox and Explorer, the absolute div comes out on top of the iframe, but in Opera, the iframe comes out on top. Is there a fix for this Opera discrepancy?

Thank you!

Min
 
Try giving both a position of relative, and a z-index, but make the div's z-index higher.

Failing that, put your div inside an iframe and repeat the above suggestion.

Hope this helps,
Dan


[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
Try giving both a position of relative, and a z-index, but make the div's z-index higher.

Failing that, put your div inside an iframe and repeat the above suggestion.

Hmmm, I don't think I would be able to do that. The absolute div is part of the drop-down menu, so it needs to stay absolute. In the worst case scenario, I could switch from iframe to a relative div, but that would change the functionality of my site.

Thanks though,
Min
 
has anyone found a solution to this problem yet ?

I have the same issue with a CSS menu and an iframe, even using z-index the iframe is still showing over the menu, instead of the otherway round!

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
i'm baffled trying to implement this
Failing that, put your div inside an iframe and repeat the above suggestion.

How do you surround a div tag with an iframe tag, I can only see iframe being used with a SRC of an external page to load into the iframe. This following example doesn't work using iframe as a surrounding tag!
Code:
<iframe>
<div>my text</div>
</iframe>
this just creates a blank iframe window and the div tag text is not diplayed.

can anyone help?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
but it is a cgi script that doesn't run on the https site where the iframe source is?

i would have to generate the dynamic code, write it to a file on the https site and redirect the browser to this area, I would also have to write PERL code to delete this file eachtime before redirecting browser and if I this file is called the same name each time there is a possibility the browser will load a cached version instead of the new one. This seems a lot of work and hastle just to make it work in Opera, none of the other browsers i've used has this problem AOL, I.E., Firefox, Netscape.

is it because Opera isn't W3C compliant, or is it all the others aren't?

"In complete darkness we are all the same, only our knowledge and wisdom separates us, don't let your eyes deceive you.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top