开发者

CSS : z-index failed to make popup container?

开发者 https://www.devze.com 2022-12-27 01:33 出处:网络
i got this css stylesheet code #nav li ul { position: absolute; visibility: hidden; float: none; top: 42px;

i got this css stylesheet code

#nav li ul {
    position: absolute;
    visibility: hidden;
    float: none;
    top: 42px;
    left: 0px;
    width: 150px;
    margin: 0;
    padding: 5px 10px 6px 10px;
    z-index: 10000;
    border: 1px solid #C0ACB2;
    border-bottom-width: 2px;
    border-bottom-color: #AF9DA3;
    border-top: 0;
    background-color: #fff;
    opacity: 0.97;
}开发者_如何学Python

#nav li:hover ul,
#nav li.iehover ul {
    visibility: visible;
}

i want to make every #nav to be hidden and then displayed when cursor hover around it. But the problem is everytime is show, it's overlapped by other div. it's seem z-index is not working to make the #nav li ul becoming the front container.

i'm testing it in firefox and flock.


Can you post up some HTML to go with that? Maybe the mistake is in your markup. Also, try using display:none; and display:block; instead of visibility. uls and lis are by definition block elements, but for hovering, this should work.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号