English 中文(简体)
ie6上的z索引问题
原标题:problem with z-index on ie6

Hy,

我在一个错误ie6上运行了几个小时,它不是我锁定的唯一一个,它仍然只是为了解决这个问题,我最终会安静下来。

我有一个我构建的垂直菜单,问题是第二级菜单与第一级菜单不重叠,尽管有z索引。在FF的领导下是无可挑剔的,在ie6中是公平的。

这是我的密码,如果你能帮我松一口气的话:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <title></title>
  </head>
<style type="text/css">
<!--


* {
    margin: 0;
    padding: 0;
}
div#menu {
    width: 100px;
}
div#menu ul {
    padding: 0;
    width: 100px;
    border: 1px solid green;
    margin: 0px;
    background: yellow url();
    position: absolute;
    z-index: 1;
}

div#menu ul li {
    position: relative;
    list-style: none;
}
div#menu ul ul {
    position: absolute;
    top: 0px;
    left: 10px;
    display: block;
    background: red url();
    z-index: 999;
    border: 1px solid black;
}
div#menu li a {
    text-decoration: none;
}
//-->  

</style>  
  <body>
    <div id="menu">
       <ul>
          <li><a href="">menu 1</a></li>
          <li><a href="">menu 2</a>
             <ul>
                <li><a href="">Sous menu 2.1</a></li>
                <li><a href="">Sous menu 2.2</a></li>
             </ul>
          </li>
          <li><a href="">menu 3</a></li>
          <li><a href="">menu 4</a></li>
          <li><a href="">menu 5</a></li>
       </ul>
    </div>
  </body>
</html>
问题回答

试试这个插件:http://docs.jquery.com/Plugins/bgiframe,将起作用!

用法:$(.your下拉菜单).bgiframe();

试试这个

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
  <head>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
  <title>Test Case</title>
  </head>
<style type="text/css">
<!--


* {
    margin: 0;
    padding: 0;
}
div#menu {
    width: 100px;
}
div#menu ul {
    padding: 0;
    width: 100px;
    border: 1px solid green;
    margin: 0px;
    background: yellow;
    position: absolute;
    z-index: 1;
}

div#menu ul li {
    list-style: none;
}
div#menu ul ul {
    position: absolute;
    left: 10px;
    display: block;
    background-color: red;
    z-index: 2;
    border: 1px solid black;
}
div#menu li a {
    text-decoration: none;
}
//-->  

</style>  
  <body>
    <div id="menu">
       <ul>
          <li><a href="">menu 1</a></li>
          <li>
             <ul>
                <li><a href="">Sous menu 2.1</a></li>
                <li><a href="">Sous menu 2.2</a></li>
             </ul>
             <a href="">menu 2</a>
          </li>
          <li><a href="">menu 3</a></li>
          <li><a href="">menu 4</a></li>
          <li><a href="">menu 5</a></li>
       </ul>
    </div>
  </body>
</html>

ie6工作在相对位置而非绝对位置

    div#menu ul {
        position:relative;
        z-index:0;
    }
   div#menu ul ul{
        z-index:2;
    }

请检查这个





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签