这是一个有趣的。
CSS:
#menu>li>a:link, #menu>li>a:visited {
color:#002349;
display: block;
float: left;
width: auto;
font-weight: 500;
font-size: 18px;
text-decoration:none;
text-transform: lowercase;
padding: 10px 10px;
}
#menu>li:hover>a {
color:#fff;
text-decoration: none;
background-color: #002349;
}
.submenu {
position:absolute;
left: -9999px;
padding:0px 0px 0px 0px;
top:32px;
margin: 0px;
text-align: left;
background-color: #002349;
width: auto;
z-index: 20;
}
#menu li:hover .submenu {
display:block;
position: absolute;
left:0px;
}
.submenu li {
text-align: left !important;
margin:0px 0px 0px 0px !important;
padding: 0px;
display:block;
clear:both;
}
.submenu li a:link, .submenu li a:visited {
color:#fff !important;
font-size: 12px;
margin: 0px;
padding:5px 12px 7px 12px !important;
margin: 0px !important;
display: block;
text-transform: uppercase;
white-space: nowrap;
}
.submenu li a:hover, .submenu li a:active {
color:#fff !important;
background: #666 !important;
text-decoration: none;
}
的HTML:
<ul id="menu">
<li><a href="http://jamie.brixwork.com/why-jamie-realtor" title="Meet Jamie MacDougall">why jamie</a>
</li>
<li><a href="http://jamie.brixwork.com/why-sothebys" title="Why Sotheby's International?">why sotheby's</a>
</li>
<li><a href="http://jamie.brixwork.com/listings" title="Featured Real Estate Listings">featured listings</a>
<ul class="submenu">
<li><a href="http://jamie.brixwork.com/listings/pageid-8/city-North+Vancouver/page-1" title="Featured Real Estate Listings">North Vancouver</a></li>
<li><a href="http://jamie.brixwork.com/listings/pageid-9/city-West+Vancouver/page-1" title="Featured Real Estate Listings">West Vancouver</a></li>
</ul>
</li>
</ul>
你可以在这里看到整个页面:http: //jamie.brixwork.com/why-sothebys
用鼠标浏览“列表”菜单。如果您的鼠标退出 UPWARDS 或 SIDEWAYS,则原始文本颜色(深蓝色)会恢复。
但是,如果您进入下拉菜单 (),然后通过将鼠标向下移出子菜单来退出,则顶部菜单的文本颜色不会变回。
为什么会这样?我有:悬停在顶部