A
A
Artem Petrenko2016-03-11 16:52:58
css
Artem Petrenko, 2016-03-11 16:52:58

How to list :not pseudo-classes?

There is such a navigation bar: It is
725a6b63dbc34b58a13ab3175130ba18.jpeg
necessary that when you hover, the links are highlighted in yellow and with a border. But not all. All except the last two (basket and search).
Tried via pseudo-class :not :

ul.navigation li:not(:last-child) a:hover {
    border-bottom:#fce38a 3rem solid;
    color:#fce38a;
  }

For one element it turns out. I try to list two - it breaks. Probably a childish question, but I'll be grateful for the answer.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
E
Elwen, 2016-03-11
@GailWynand

ul.navigation li:not(:nth-last-child(-n+2)) a:hover{
    border-bottom:#fce38a 3rem solid;
    color:#fce38a;
  }

T
tigra, 2016-03-11
@tigroid3

well, as an option, just assign some class to these li, for example, no-active, and then

ul.navigation .no-active a:hover {
    border-bottom:none;
    color:white;
  }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question