0

I want to apply red color only to class t2 which are followed by t3.

For example

<div class="t1">
  <div class="t2">2</div>
  <div class="t3">3</div>
</div>
<div class="t1">
  <div class="t3">3</div>
  <div class="t2">2</div>
  <div class="t4">4</div>
</div>
<div class="t1">
  <div class="t2">2</div>
</div>

I want to apply red color only to class t2 which are followed by t3 in class t1.

t2 + t3 -> selects t3 and applies css to t3 t2 ~ t3 also does the same.

what other options do I have. Order of t2 is not know as it might be first/last/any child of t1.

Sumant
  • 276
  • 1
  • 12

0 Answers0