我的<div>与我的下拉选项卡重叠</div>

时间:2013-08-25 21:23:26

标签: html css html5 css3

我在我的网站上用我的div标签很难...每次我将鼠标悬停在街机选项卡或其他下拉菜单上时,它都会落在我的电影后面!我希望这与标签覆盖div的相反。有什么建议吗?

这是我一直在使用的CSS:

nav ul ul {
    display: none;
}

nav ul li:hover > ul {
    display: block;
}
nav ul {
    background: #efefef; 
    background: linear-gradient(top, #D8D8D8  10%, #D0D0D0 90%);  
    background: -moz-linear-gradient(top, #D8D8D8  10%, #D0D0D0 90%);
    background: -webkit-linear-gradient(top, #D8D8D8  10%, #D0D0D0 90%);
    box-shadow: 0px 0px 9px 0px rgba(0,0,0,0.15);
    padding: 0px 20px;
    border-radius: 10px;  
    list-style: none;
    position: relative;
    display: inline-table;
}
nav ul:after {
    content: ""; clear: both; display: block;
}
li {
    float: left;
}
nav ul li:hover {
    background: #4b545f;
    background: linear-gradient(top, #4f5964 0%, #5f6975 40%);
    background: -moz-linear-gradient(top, #4f5964 0%, #5f6975 40%);
    background: -webkit-linear-gradient(top, #4f5964 0%,#5f6975 40%);
}
    nav ul li:hover a {
        color: #fff;
    }

nav ul li a {
    display: block; padding: 10px 40px;
    color: #757575; text-decoration: none;
    font-family:arial;
}
nav ul ul {
    background: #5f6975; border-radius: 0px; padding: 0px;
    position: absolute; top: 100%;
}
nav ul ul li {
    float: none; 
    border-top: 1px solid #6b727c;
    border-bottom: 1px solid #575f6a;
}
    nav ul ul li a {
        padding: 10px 40px;
        color: #fff;
        font-family:arial; font-weight:900;
    }   
        nav ul ul li a:hover {
            background: #4b545f;
        }
nav ul ul ul {
    position: absolute; left: 100%; top:0;
}

这是我在页面上的HTML重叠内容:

    <div id="text"><h1>Featured!</h1></div>
<div id="boxed">
    <div id="movie">Ghost Shark</br><img src="/movies/posters/Ghost Shark.jpg"></div>
</div>

这是导航窗格的HTML:

<center><nav>
<ul>
    <li><a href="/">Home</a></li>
    <li><a href="">Arcade</a>
        <ul>
            <li><a href="/arcade/action">Action</a></li>
            <li><a href="/arcade/arcade">Arcade</a></li>
            <li><a href="/arcade/puzzle">Puzzle</a></li>
            <li><a href="/arcade/vehicle">Vehicle</a></li>
            <li><a href="/arcade/violence">Violence</a></li>
            <li><a href="/arcade/defense">Defense</a></li>
            <li><a href="/arcade/rpg">RPG</a></li>
        </ul>
    </li>
    <li><a href="">Watch</a>
        <ul>
            <li><a href="/watch/tv">TV Shows</a></li>
            <li><a href="/watch/movies">Movies</a></li>
        </ul>
    </li>
    <li><a href="">Extras</a>
        <ul>
            <li><a href="/news">News</a></li>
            <li><a href="/updates">Updates</a></li>
        </ul>
    </li>
    <li><a href="/support">Support</a></li>
</ul>
</nav></center>

它所在的网站是http://gameshank.com/movies/horror/

谢谢你!

1 个答案:

答案 0 :(得分:0)

z-index设置为nav

nav {
    z-index: 1000;
}