Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having trouble getting an Openlayers div to allow other divs to appear above it.

Having tried the solution proposed here as well as the more classy-looking one here, I haven't had any luck yet. Openlayers always orders itself over other divs. I've also set the z-index for my other div (which I want on top) as high as it goes, still no effect.

Is there somewhere it could be getting overridden? Or some setting that needs an extra trick to get rid of?

I have asked this question on StackOverflow as well, where it's arguably more relevant. I'm only posting this here because someone here may have specific Openlayers experience on this matter.

share|improve this question
up vote 6 down vote accepted

To handle a z-index CSS property, the element must be positioned. It means it must take the value absolute, fixed or relative.

here comes an example :

#map {position:absolute;z-index:0}
.popup {position:absolute;z-index:2}

You can post your code or provide a link if you need any help

share|improve this answer
Ha! Oh wow, that was dumb of me... But yes, this worked, thanks. I forgot to position it :) – R Thiede Sep 27 '11 at 8:45

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.