2014-11-22 47 views
1

我有一個固定定位標題下拉菜單,我希望下拉框出現在另一個固定的定位元素的前面。 我已經嘗試了兩個元素上的z-index,並且我已經檢查過,這兩個元素都有一個位置。CSS z-index:「position:relative;」元素位於「位置:固定」之上元素 - 它不會工作

參見TIS撥弄:http://jsfiddle.net/ng8u8zjx/1/

下拉框中我示出包含在 「+」 的元件後面。我想在前面。

.dashboard-header { 
     width: 100%; 
     height: 50px; 
     position: fixed; 
     top: 0; 
     background-color: #FF555F; 
    } 
... 
    .dashboard-header .user-menu ul ul { 
     display: none; 
     background-color: #FF555F; 
     height: auto; 
     text-align: center; 
     z-index: 10; 
     position: relative; 
    } 
... 
    /* ADD NEW START */ 
    article.content header a.add-new { 
     color: #FFF; 
     line-height: 32px; 
     text-align: center; 
     background-color: #FF555F; 
     border-radius: 5px; 
     width: 30px; 
     height: 30px; 
     display: block; 
     position: fixed; 
     right: 10px; 
     top: 60px; 
     font-size: 22px; 
     text-decoration: none; 
     z-index: 1; 
    } 

回答