I’m trying to make a div visible when a different div is hovered but for some reason the wrong div is displaying instead. You will see what I mean on the link below. I want the second heart icon to display on the box that is being hovered instead of the one next to it.
.box-product-item:hover + .box-product-item .compare {
display: inline-block;
}
I hope that makes sense.
You need to change your css rule to
getting rid of the sibling selector portion. As you have it now, it’s saying that any
.compareinside a.box-product-itemwhich is itself immediately preceded by a.box-product-itemwhich is being hovered, shoulddisplay: inline-block.