我一直在为我的雇主建立这个网站,除了 IE,这个问题不会在任何浏览器中发生。将鼠标悬停在“服务”按钮上时,右侧会出现两个按钮。将鼠标悬停在两个选项上时,按钮会在按钮的 5px 内消失。我想避免将两个按钮与导航栏齐平,因为它看起来很奇怪。关于如何增加悬停大小的任何想法?
HTML:
<div id="menu">
<ul>
<li>
<a href="index.htm">
<img src="comps/PillarHP/ButtonLinks/Home.jpg" border="0" />
</a>
</li>
<br />
<br />
<br />
<li>
<a href="TTUgalleries.html">
<img src="comps/PillarHP/ButtonLinks/TTUgalbutton.jpg" border="0" />
</a>
</li>
<br />
<br />
<br />
<li>
<a href="STATEgalleries.html">
<img src="comps/PillarHP/ButtonLinks/Landgalbutton.jpg" border="0" />
</a>
</li>
<br />
<br />
<br />
<li>
<a nohref="">
<img src="comps/PillarHP/ButtonLinks/Services.jpg" border="0" hspace="50" />
</a>
<ul class="sub-menu">
<li>
<a href="classes.html" id="demargpadLink"><img src="comps/PillarHP/ButtonLinks/classes.jpg" border="0" /></a>
</li>
<li>
<a href="mats.html"><img src="comps/PillarHP/ButtonLinks/Mats.jpg" border="0" /></a>
</li>
</ul>
</li>
<br />
<br />
<br />
<li>
<a href="newsletter.html">
<img src="comps/PillarHP/ButtonLinks/Newsletter.jpg" border="0" />
</a>
<ul class="sub-menu">
<li></li>
</ul>
</li>
<br />
<br />
<br />
<li>
<a href="artiststatement.html">
<img src="comps/PillarHP/ButtonLinks/ArtStatement.jpg" border="0" />
</a>
</li>
<br />
<br />
<br />
<li>
<a href="contact.html">
<img src="comps/PillarHP/ButtonLinks/Contact Us.jpg" border="0" />
</a>
</li>
</ul>
CSS:
#menu {
position: absolute;
margin-left: 179px;
margin-top: 200px;
z-index:15;
padding-bottom: 0px;
}
a {
text-decoration: none;
color: #838383;
}
a:hover {
color: black;
}
#menu a {
display: block;
width: 140px;
}
#menu ul {
list-style-type: none;
padding-top: 10px;
}
#menu li {
float: left;
position: relative;
margin-left: 1px;
margin-right: 1px;
text-align: center;
}
#menu ul.sub-menu {
display: none;
position: absolute;
top: -14px;
left: 139px;
padding: 10px;
z-index: 90;
}
#menu ul.sub-menu li {
text-align: left;
}
#menu li:hover ul.sub-menu {
display: block;
}
#menu li:hover ul.sub-menu a {
margin-top: 4px;
margin-bottom: 0;
padding: 0;
}
包含 div CSS:
#menu {
position: absolute;
margin-left: 179px;
margin-top: 200px;
z-index:15;
padding-bottom: 0px;
}