-2

Hi iam working on a shopify website , here is the link https://i6g770fcpgv7w1o8-53431074968.shopifypreview.com/, the help I want is to show the title of the product which is coming over the image only on hover of the product image, can please some one guide me

 
<style>
          span#tit_pro {
  display: none;
}
    
.ProductItem__LabelList:hover + span#tit_pro {
  display: block;
  color: red;
}
        </style>
<span id="tit_pro">MYSHA FUCHSIA SCHIFFLI-ORGANZA DRESS</span>
<span class="ProductItem__Label Heading Text--subdued">New</span>
Rahul
  • 91
  • 8

1 Answers1

0

You're using adjacent sibling selector (+) and that's why you don't see desired result. Since span#tit_pro is not adjacent sibling of your .ProductItem__LabelList it won't work. You can either use child selector (>) or just use descendant selector.

I think this should solve your problem:

<style>
span#tit_pro {
  display: none;
}
    
.ProductItem__LabelList:hover > span#tit_pro {
  display: block;
  color: red;
}
</style>
gagz
  • 211
  • 3
  • 8