V
V
valitskiydmitriy2015-10-08 12:21:50
css
valitskiydmitriy, 2015-10-08 12:21:50

Change background-image of div to li, numbered in css?

I don't know how to describe clearly, but I'll try. There is a structure like this:

ul
   li
     a
       div (background img..)
   li
     a
       div (background img..)

What is the point, it is necessary that when you hover, on the div, its bacground changes to the one that is written in css. But each of the following paragraphs has its own background in css, I tried to do this:
.jcarousel-skin-opencart li:nth-child(2) .childjs:hover {
...
}

does not work, while there is a childjs removed, the background of li changes

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
Nikita K., 2015-10-08
@valitskiydmitriy

I think you need to do this
.jcarousel-skin-opencart li:nth-child(2):hover .childjs{
}

A
Alexander Zubarev, 2015-10-08
@zualex

ul>li:nth-child(2)>a>div:hover{
    ...
}

Here is a similar example, only here it’s not the background, but the color is different for li: jsfiddle.net/jeZHD/2

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question