-1

I have two parents classes that have the same name but one has additional child class. I want to only select a child class from the parent class with that additional child class.

class = money-styling
     class = compare-at-price
     class = money

class = money-styling
      class = money

I want to select money class that has a sibling compare-at-price. Only code I could write was"

.money-styling .money{
    color:#ff0000;
}

How do I go about doing that?

  • 1
    For example: `.money-styling .compare-at-price + .money` – bron Nov 19 '21 at 19:50
  • 1
    Could you show us some HTML because it's going to depend on the positions in relation to each other - and I'm not sure what a 'child class' is. – A Haworth Nov 19 '21 at 19:55

1 Answers1

0
use this one 

.money-styling .compare-at-price ~ .money{
   color:red;
}