1

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

你们能帮帮我吗?请我绝望,我不知道如何使这项工作!:/

4

1 回答 1

0
#wsite-menus .wsite-menu: hover #navigation ul li a {
    color: #333;
}
于 2014-03-30T07:42:41.253 回答