为什么我的菜单出现在内容下面 [英] why is my menu is appearing under content

查看:93
本文介绍了为什么我的菜单出现在内容下面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个菜单和下面的滑块

滑块图像显示在菜单项上方的奇怪之处。一旦光标到达滑块边框,菜单就会消失

I have a menu and a slider below
the strange thing that slider images are showing above menu items. and menu disapears once he cursor reaches the slider border

#container {
    position: relative;
    width: 940px;
}

#container:after {
    content: "";
    display: block;
    clear: both;
    height: 0;
}

#menu {
    position: relative;
    float: left;
    width: 100%;
    padding: 0 20px;
    border-radius: 3px;
    box-shadow: inset 0 1px 1px rgba(255,255,255,.5), inset 0 -1px 0 rgba(0,0,0,.15), 0 1px 3px rgba(0,0,0,.15);
    background: #ccc;
}

#menu, #menu ul {
    list-style: none;
}

#menu > li {
    float: left;
    position: relative;
    border-right: 1px solid rgba(0,0,0,.1);
    box-shadow: 1px 0 0 rgba(255,255,255,.25);
    perspective: 1000px;

}


#menu a {
    display: block;
    position: relative;
    z-index: 999;
    padding: 13px 20px 13px 20px;
    text-decoration: none;
    color: rgba(75,75,75,1);
    line-height: 1;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: -.05em;
    background: transparent;
    text-shadow: 0 1px 1px rgba(255,255,255,.9);


}

#menu > li:hover > a {
    background: #333;
    color: rgba(0,223,252,1);
    text-shadow: none;
}

#menu li ul  {
    position: absolute;
    left: 0;
    z-index: 999;
    width: 200px;
    padding: 0;
    opacity: 0;
    visibility: hidden;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
}


#menu li:hover ul {

    padding: 15px 0;
    background: #333;
    opacity: 1;
    visibility: visible;
    box-shadow: 1px 1px 7px rgba(0,0,0,.5);
    z-index: 1000;
    /*animation-name: swingdown;
    animation-duration: 1s;
    animation-timing-function: ease;*/

}

@keyframes swingdown {
    0% {
        opacity: .99999;
        transform: rotateX(90deg);
    }

    30% {
        transform: rotateX(-20deg) rotateY(0deg);
        animation-timing-function: ease-in-out;
    }

    65% {
        transform: rotateX(20deg) rotateY(0deg);
        animation-timing-function: ease-in-out;
    }

    100% {
        transform: rotateX(0);
        animation-timing-function: ease-in-out;
    }
}

#menu li li a {
    padding-left: 15px;
    font-weight: 400;
    color: #ddd;
    text-shadow: none;
    border-top: dotted 1px transparent;
    border-bottom: dotted 1px transparent;
    z-index: 1000;
}

#menu li li a:hover {
    color: rgba(0,223,252,1);
    border-top: dotted 1px rgba(255,255,255,.15);
    border-bottom: dotted 1px rgba(255,255,255,.15);
    background: rgba(0,223,252,.02);
    z-index: 100;
}

推荐答案

这是一个z-index问题...尝试放少一些(如果z- index:999)内容值和菜单值更大(put z-index:1000)
It's an z-index problem... Try to put lesser (if z-index:999) value for content and greater value for menu (put z-index:1000)


这篇关于为什么我的菜单出现在内容下面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆