如何在母版页中正确设置菜单 [英] how to set menu correctly in master page

查看:69
本文介绍了如何在母版页中正确设置菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我在主页面上有一个菜单



Hi,
I have a menu in the master page as

<div>
                      <ul id="nav">
                          <li><a href="#">Home</a></li>

                          <li><a href="#">Portfolio</a></li>
                          <li><a href="#">Contact</a>
                              <ul>
                                  <li><a href="#">International</a></li>
                                  <li><a href="#">Corporate</a>
                                      <ul>
                                          <li><a href="#">International</a></li>
                                          <li><a href="#">Corporate</a></li>
                                          <li><a href="#">American Offices</a></li>
                                      </ul>
                                  </li>
                                  <li><a href="#">American Offices</a></li>
                              </ul>
                          </li>
                          <li><a href="#">Mission Statement</a></li>
                          <li><a href="#">Portfolio</a></li>
                      </ul>
                  </div>





css





css

#nav {


 margin: 0; padding: 0;

}

#nav li a, #nav li {
 float: left;

}

#nav li {
 list-style: none;
 position: relative;
}

#nav li a {
 padding: 1em 2em;
 text-decoration: none;
 color: #262626;
 background: #ffff00;

 border-top: 0px solid #545454;
 font-family:Calibri;
 font-size:1opx;
}

#nav li a:hover {
 background: #003b80;
 background: -moz-linear-gradient(top, #11032e, #2a0d65);
 background: -webkit-gradient(linear, left top, left bottom, from(#11032e), to(#2a0d65));
  color: #fff;
}


/* Submenu */

.hasChildren {
	position: absolute;
	width: 5px; height: 5px;
	background: black;
	right : 0;
	bottom: 0;
}

#nav li ul {
 display: none;
 position: absolute;
 left: 0;
 top: 100%;
 padding: 0; margin: 0;
}

#nav li:hover > ul {
 display: block;
}

#nav li ul li, #nav li ul li a {
 float: none;
}

#nav li ul li {
 _display: inline; /* for IE6 */
}

#nav li ul li a {
 width: 150px;
 display: block;
}

/* SUBSUB Menu */

#nav li ul li ul {
 display: none;
}

#nav li ul li:hover ul {
 left: 100%;
 top: 0;
}


/*#nav li ul*/ 





我有一个主页,我有图片横幅,问题是当我将鼠标悬停在主菜单上时

项目的子菜单项目进入div(图片横幅)。

我的菜单工作正常。



我无法理解为什么子菜单是悬停在图片横幅(div)内。



请帮助



I have a home page ,where i have image banner ,the problem is when i mouse over on the menu main
item the sub-menu item are going inside the div (image banner).
My Menu is working properly.

I am not able to understand why submenu are hovering inside the image banner (div).

Please help

推荐答案

增加z-index为子菜单类使菜单越过其他div
Increase the z-index for submenu class to make menu come over the other divs


这篇关于如何在母版页中正确设置菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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