子菜单无法正常工作
问题描述:
我无法将子菜单置于tab2上的父级顶部。我的意思是,当我悬停在tab2下面的子菜单apears。我用我自己制作的按钮(图片)。有人可以整理演示中的css代码吗?非常感谢你:)这里是演示http://jsfiddle.net/3Lhe7/子菜单无法正常工作
@charset "utf-8";
/* CSS Document */
body {
max-width: 1000px;
text-align: right;
/*text-align: center;*/
}
.bg {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: -5000;
}
#navigation {
clear: both;
width: 60%;
margin: 0 auto;
border: 0px;
text-align: left;
position: absolute;
top: 65%;
left: 20%;
height: 90px;
min-width:830px;
max-width:1000px;
}
#navigation ul {
display: inline-block;
margin: 0 auto;
}
#navigation ul li {
display: inline;
position: relative;
float: left;
list-style-type: none;
height: 45px;
}
#navigation li ul {
margin: 0px;
padding: 0px;
display: none;
position: absolute;
}
#navigation ul li a {
list-style: none;
display: block;
width: 150px;
height: 90px;
padding: 0px;
}
#navigation ul li ul {
display: none;
}
#navigation ul li:hover ul {
display: block;
bottom: 100%;
}
#submenu {
list-style: none;
display: block;
width: 150px;
height: 45px;
padding: 0px;
margin: 0px;
}
答
我不知道背后的制作#submenu
的身高×45像素,但改变这种(在height
属性)来0
你的推理似乎解决了问题。
#submenu {
list-style: none;
display: block;
width: 150px;
height: 0;
padding: 0px;
margin: 0px;
}
+0
是的,它解决了这个问题,谢谢:) – 2013-03-07 19:01:28
发布您的代码/工作演示 – Sowmya 2013-03-06 11:44:58
您可以添加访问图片src到你的代码演示? – SaidbakR 2013-03-06 11:48:11
为了整理代码,请在jsfiddle中使用'TidyUp'按钮:) – Morpheus 2013-03-06 11:49:57