0

I have this in html :

<li *ngFor="let menu of menus" class="{{ menu.attributes.class }} menu-items" [attr.data-title]="menu.label">
    <a [routerLink]="[menu.url||'/']" [queryParams]="menu.refParameter3 ? menu.refParameter3:{}"(click)="clicked = true;selectMenu(menu)">
        <i *ngIf="menu.icon" class="{{menu.icon}}"></i>
        <span>{{menu.label}}</span>
        <i *ngIf="menu.children && menu.children.length" class="subarrow fa fa-angle-right"></i>
    </a>

    <z-menu class="childrens" *ngIf="menu.children && menu.children.length" [menus]="menu.children" [parent]="menu.label"></z-menu>
</li>

In css i have this:

.menu-items:hover::before {
  content: attr(data-title);
  position: absolute;
  bottom: -80px;
  display: inline-block;
  padding: 0px 6px;
  border-radius: 2px;
  background: #fff;
  color: gray;
  font-size: 11px;
  font-family: sans-serif;
  white-space: nowrap;
  z-index: 999;
  height: 30px;
  min-width: 100px;
  left: 17px;
  text-align: center;
  line-height: 30px;
  font-weight: bold;
  border: 1px solid gray;
  visibility: 1s
}

So what i want is when i hover on li that have childrens class as parent to hide before content on parent element. Any suggestion?

None
  • 6,894
  • 20
  • 72
  • 144
  • 1
    First of all, please provide a _proper_ [mcve]. That angular stuff is not “runable” to any of us here without setting up a complete project; so please create a static HTML example that reproduces the problem. – CBroe May 28 '18 at 08:01
  • Possible duplicate of [Is there a CSS parent selector?](https://stackoverflow.com/questions/1014861/is-there-a-css-parent-selector) – CBroe May 28 '18 at 08:02

1 Answers1

0

I don't really understand what you want to achieve!

Do you want to show the :before selector by default and then hide it once you hover over a li element that has a childrens class? Is that what you want??

And please do as @CBroe suggested.

Hasan Sh
  • 878
  • 7
  • 13
  • what do i do from @CBroe suggestion ? because has is not supported by any browser ? – None May 28 '18 at 08:25