Lira Lira - 5 days ago 5
CSS Question

Overlay Menu button on my open layers 3 map

I want to overlay a menu button on my map. So when I click this button it will apper a window. I created the map div and the overlayMenu button div but it doesn't show me the button where I want. I want the pointed button to be near to the zoom buttons and the white area to disapear.



Here is the code to the HTML file:

<div id="map" style="width:100%; height:100%; z-index: 0">
<div id="overlayMenu" style="z-index:9999"></div>

Answer

You can control the placement of the menu button over the map using the CSS Position Property.

You may also need to give the menu a positive z-index. Note that the z-index Property only applies to "positioned" elements - elements with position other than static.

#overlayMenu {
    position: absolute;
    z-index: 1;
    top: 10px;
    left: 50px;
}
Comments