views:

900

answers:

3

I am working on a web application that has a menu across the top of every page with sub menus that drop down when a menu item is hovered over. This works fine, except on one page where we are trying to show a pdf in an iframe. The hover menus all end up behind the iframe in this one case. I have tried adjusting the z-index of both the hover menu and the iframe but neither seems to work. This is occurring in both FireFox 3.5 and IE8 so far.

There are two ways my question could be solved. I can either find a way to accurately adjust the CSS so my menu appears in front of the iframe or if there is another way to show the pdf that doesn't have this issue I could do that too.

Thanks!

A: 

This is likely because PDFs are displayed in a plugin, rather than natively in the web browser. CSS will not have an effect on this, because CSS only applies to content rendered in the web browser. Google does have a system that converts PDFs to HTML for display in browsers, at which point there would be no z-index issues, but some formatting may be lost in the process, and of course it is no longer a PDF document. Unless there is some way to tell the PDF plugin itself to lower its z-index (and consider that not all users will be using the Adobe plugin, some may use Foxit or other programs) you may be out of luck.

qid
Thats what I was afraid of. I will have to look into this more and see if it will work for this project's needs (though I may not have much of a choice). Thanks for your input.
Josh
A: 

Try position:relative and z-index adjustment to get it in front of the iframe.

Soufiane Hassou
I tried this and it is still appearing behind the iframe. Thanks for the thought though.
Josh
A: 

You're showing a pdf in an iframe? I'm guessing it has some sort of flash viewer? If so, then make sure you set the wmode of the flash embed code appropriately.

http://kb2.adobe.com/cps/155/tn%5F15523.html

tybro0103
(if it is set to window then it will always be on top of everything disregarding any css)
tybro0103
No flash viewer. As long as you have a pdf plugin (adobe, foxit, etc) you can just set the source of the iframe to the pdf and it will render there.
Josh