所以,我是CSS和HTML的初学者,我正在尝试从过去一小时开始工作,但它只是不会!
所以我希望当鼠标在下拉菜单中查看该父项的子项时,父菜单项会保持悬停。
这是我的代码..
HTML
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body class='short-header-page wsite-theme-light'>
<div id="header-wrap">
<div class="container">
<table id="header">
<tr>
<td id="header-right">
<table>
<tr>
<td class="phone-number">{phone:text}</td>
<td class="social">{social}</td>
<td class="search">{search}</td>
</tr>
</table>
<div class="clear"></div>
</td>
</tr>
</table>
</div><!-- end container -->
</div><!-- end header-wrap -->
<div id="nav-wrap">
<div class="container">
<table>
<tr>
<td id="logo">{logo}</td>
<td id="nav"><div id="navigation">{menu}</div></td>
</tr>
</table>
</div><!-- end container -->
</div><!-- end nav-wrap -->
<div id="banner-wrap">
<div class="container">
<div id="banner">
<div class="wsite-header"></div>
<div style="clear:both;"></div>
</div><!-- end banner -->
</div><!-- end container -->
</div><!-- end banner-wrap -->
<div id="main-wrap">
<div class="container">
{content}
</div><!-- end container -->
</div><!-- end main-wrap -->
<div id="footer-wrap">
<div style="visibility:hidden;"class="container">
{footer}
</div><!-- end container -->
</div><!-- end footer-wrap -->
</body>
</html>
CSS
/* Navigation
--------------------------------------------------------------------------------*/
#nav-wrap .container {
clear: both;
overflow: hidden;
position: relative;
border-bottom:1px solid #E8E8E8;
margin-bottom:40px;
}
#nav-wrap .container table, #nav-wrap .container table tr, #nav-wrap .container table tr td, #nav-wrap .container table tbody {
vertical-align:bottom;
}
td#nav {
float:right;
}
#navigation {
line-height: 1;
float: right;
}
#navigation ul {
display: inline;
list-style: none;
float: right;
max-width:700px;
margin-bottom:-1px;
}
#navigation li {
display: inline;
position: relative;
list-style: none;
margin-left:6px;
float: left;
}
#navigation ul li a {
display: block;
color: #333;
text-decoration: none;
padding: 18px 7px 8px;
margin:0 0px 1px;
border: 0;
outline: 0;
list-style-type: none;
box-sizing:border-box;
float: left;
font:13px 'Bookman',arial,sans-serif;
text-transform:uppercase;
}
#navigation ul li#active a{
padding: 18px 7px 4px;
border-bottom:4px solid #72bc11;
color:#000;
}
#navigation ul li a:hover {
padding: 18px 7px 4px;
border-bottom:4px solid #FF6600;
color: #000A0F;
}
#navigation ul li a:hover {
padding: 18px 7px 4px;
border-bottom:4px solid #FF6600;
color: #000A0F;
}
/* Navigation Submenu's
--------------------------------------------------------------------------------*/
#wsite-menus .wsite-menu {
background:#fff;
position:relative;
}
#wsite-menus .wsite-menu li a {
background: #F4F4F4;
border:none;
border-bottom: 1px solid #E8E8E8;
border-top: 1px solid white;
display: block;
}
#wsite-menus .wsite-menu li a:hover {
color: #72bc11;
background: #eee;
}
你能帮帮我们吗?请我绝望,我不知道如何使这项工作! :/
答案 0 :(得分:0)
#wsite-menus .wsite-menu: hover #navigation ul li a {
color: #333;
}