将鼠标悬停在子菜单上时的父悬停状态

时间:2014-01-17 13:15:53

标签: css menu

当鼠标悬停在子菜单链接上时,如何将三角悬停状态包含在父链接中? http://website-test-lab.com/sites/tcf/locals/

目前,css三角形出现在悬停时和当前页面上。如果您访问上面的链接并将鼠标悬停在ABOUT链接上,然后将鼠标悬停在子菜单上,您将看到三角形消失。我想留下来。

这是我的CSS:

    .nav ul li a:hover:after,
.nav .current-menu-item:after,
.nav .current_page_parent:after {
    content: "";
    position: absolute;
    bottom: 0px;
    left: 28px;
    margin: 0 auto;
    display: block;
    width: 0px;
    height: 0px;
    border-style: solid;
    border-width: 0 31px 10px 15px;
    border-color: transparent transparent $pink transparent;
}   

提前致谢

1 个答案:

答案 0 :(得分:3)

您可能需要更改触发:hover状态的元素,实际上您已<a>标记将其更改为<li>

你有这个选择器:

.nav ul li a:hover:after 

将其更改为:

.nav ul li:hover > a:after 
相关问题