user3697236
user3697236

Reputation: 29

z-index not working between two menus

I have a page top containing two menus. The problem is that when one of the submenus is unwrapped, it doesn't show (the other menu covers it). I've tried with z-index but it doesn't work. Thanks in advance. The page and the code are avaliable in http://infoglobal.eu1.frbit.net/En/cap.php.

Upvotes: 1

Views: 59

Answers (5)

Bunyomayn
Bunyomayn

Reputation: 34

You only need this.

.menu {z-index:100}

Upvotes: 0

Roy M J
Roy M J

Reputation: 6938

Your html and CSS is messed up a bit

#top{
   z-index:13 //This is not needed
}

.menu{
   z-index: 10 //This is also not needed
}

#canvi_idioma{
   z-index:1 //Simply add this
}

Upvotes: 1

plexus
plexus

Reputation: 1798

In your css you use z-index on '.menu' but that affects both menus. You have to apply it to #menu and #canvi_idioma.

Also note that z-index only works when both elements are within the same parent node.

Also your code is kinda dirty. You may want to clean up things like this with position beeing in there two times:

#canvi_idioma {
background: transparent;
  position: absolute;
  right: -95%;
  top: 40px;
  position: relative; 
}

Upvotes: 0

Adarsh Gowda K R
Adarsh Gowda K R

Reputation: 951

Apply z-index to #canvi_idioma

CSS

#canvi_idioma{
z-index:9999
}

Upvotes: 0

wikijames
wikijames

Reputation: 192

You can use z-index with position.

css example

.Class{
    position:relative; //You have to choose atleast one position type.
    z-index:100; // value can be change according to you .
}

Upvotes: 0

Related Questions