My question should be pretty solid. For some reason, I canβt hug my head around me today.
I create a menu with a structure like this
<div class="wrapper"> <ul> <li class="menu-item"><a href="#">Menu Item</a> <div class="inner"> <a href="#">Login</a> </div> </li> </ul> </div>
I am trying to target a login link using the following css selector:
.inner a{}
The selector works, however the following selector accepts css presidence and overrides the above selector:
li.menu-item a{}
I am completely baffled. Why does the second selector prefer style over the first? How do you guys recommend me aiming at the above "a" elements?
source share