R
R
Ruslan2014-06-12 08:09:29
css
Ruslan, 2014-06-12 08:09:29

How to make a menu whose items darken on hover?

Hello!
I want to make a menu, on pointing at the items of which it changes color, i.e. if we have a white background, then it turns gray on hover?

<div class="sidebar">
    <li><a href="/">Главная</a></li>
    <li><a href="/odezhda">Спортивная одежда</a></li>
    <li><a href="/obuv">Спортивная обувь
    </a></li><li><a href="/enter">Вход</a></li>
</div>

Preferably in css, if at all possible

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Svyatoslav Belimov, 2014-06-12
@Izmena

.sidebar a:hover{
background: #333;
}
Then I think it's not worth telling, and so everything is clear

G
gubski, 2014-06-12
@gubski

.sidebar ul li{
color: #000;
transition: all 0.4s ease-in-out;
}
.sidebar ul li:hover {
background: #DDD;
}

Y
Yuri Lobanov, 2014-06-12
@iiil

Where is your ul?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question