我想在导航二级菜单时保持父级悬停颜色相同.
这是一段视频,解释了我想要完成的任务:http://screencast.com/t/Bhfj6mtZkPZp
这是导航代码:
.primary-navigation { max-width: 1192px; margin: 20px 0px 52px 1px; } .primary-navigation ul { font-family: 'Josefin Sans',sans-serif; font-size: 18px; font-size: 1.125rem; font-weight: bold; margin: 0; padding: 0; list-style: none; } .primary-navigation ul li { display: block; position: relative; float: left; } .primary-navigation li ul { display: none; } .primary-navigation ul li a { display: block; text-decoration: none; color: #fff; background: #ec6397; padding: 12px 22px 17px 22px; white-space: nowrap; -moz-transition: all 0.25s ease-in-out; -webkit-transition: all 0.25s ease-in-out; transition: all 0.25s ease-in-out; border-right: 1px solid #f39cbd; } .primary-navigation ul li a:hover { background: #f39cbd; } .primary-navigation li:hover ul { display: block; position: absolute; border-top: 1px solid #f39cbd; border-left: 1px solid #f39cbd; } .primary-navigation li:hover li { float: none; width: 300px; z-index: 3; border-bottom: 1px solid #f39cbd; } .primary-navigation li:hover a { background: #ec6397; } .primary-navigation li:hover li a:hover { background: #f39cbd; color: #000; }