gpt4 book ai didi

html - Weebly Navigation - 父菜单项在鼠标悬停在子项上时保持悬停状态

转载 作者:太空宇宙 更新时间:2023-11-03 18:45:15 25 4
gpt4 key购买 nike

所以,我是 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;
}

你们能帮帮我吗?拜托,我很绝望,我不知道如何进行这项工作! :/

最佳答案

#wsite-menus .wsite-menu: hover #navigation ul li a {
color: #333;
}

关于html - Weebly Navigation - 父菜单项在鼠标悬停在子项上时保持悬停状态,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16532045/

25 4 0