2010-09-01 35 views

回答

0

檢查包含菜單的容器是否有相對位置。 Z索引僅適用於具有「絕對」相對位置屬性的元素。

例如:

<div style="position:relative">Menu here</div> 
+0

我做了一個包裝的div我的整個頁面設置相對的,把我的下拉菜單中絕對的。我不能相信我只是爲了一個菜單有另一種方式嗎? – alexchenco 2010-09-01 10:45:44

0

通過CSS兩種元素添加Z-index屬性。 (菜單)和(滑塊)

<div style="z-index:2;">Menu</div> 

<div style="z-index:1;">Slider (or whatever coming after the menu)</div> 

,是的,原因是使用兩個元素與position:relative;