Click here to Skip to main content
15,891,744 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In a HTML page, a map displays well. Now, I am testing to add a popup on the top of the map. I created a
block w/ an image in it.

This div's css is defined as

CSS
.app1 {
    background: url("../images/Backgound.png") repeat-y scroll left top transparent; 
    height: 1000px; 
    width: 400px;
    margin-left: 500px;
    z-index: 999999 !important;
}


When the page starts, I can see the
block w/ the image. However, after a second when the map is loaded, the image is covered. Here, I defined a very large z-index, but it still does not work.

Hopefully, you can hint me for the solution.

Thanks.
Posted
Updated 6-Oct-15 18:34pm
v2

CSS
.app1 {
        background: url("../images/Backgound.png") repeat-y scroll left top transparent; 
        height: 1000px; 
        width: 400px;
        margin-left: 500px;
        z-index: 999999 !important;
    
        padding:50px; /* will leave the inner space*/
        position: fixed; /*fixed irrespective of scroll bars*/
        top: 10px; /* will display the 10px far from the top*/
        left: 40%; /* will display 40% far  from the left side */
}

Try this, and let me know if it works :)

-KR
 
Share this answer
 
Comments
s yu 7-Oct-15 10:32am    
Yes. It works. Thanks a lot.
z-index only works on positioned elements (position:absolute, position:relative, or position:fixed).

So, try like:

CSS
.app1 {
    background: url("../images/Backgound.png") repeat-y scroll left top transparent; 
    height: 1000px; 
    width: 400px;
    margin-left: 500px;
    position:relative; /* or you can also try absolute/fixed */
    z-index: 999999 !important;
}
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900