0

I have the following html structure ( i cannot change , generated by JS ) :

<ul>
<li>
  <a>
    <span class="current-info">Step X: </span>
    <span class="number">1.</span>
    <span class="booking-icon">Date</span>
  </a>
</li>
<li>
  <a>
    <span class="current-info">Step X: </span>
    <span class="number">2.</span>
    <span class="calendar-icon">Date</span>
  </a>
</li>
...

And class "number" has the following css by default:

#bds-bf.wizard > .steps > ul > li.current > .number:after{
content: '\f2b4';
font-family: FontAwesome;
}

Class "number" is repeated many times, so i cannot change content based on it. What i want to do is change the value of

#bds-bf.wizard > .steps > ul > li.current > .number:after

based on its sibling's class , so for example if it found .booking-icon class in the next sibling it should make content like:

content: "\f0f9'

How can i achieve this with css selectors without using Javascript ?

UPDATED: JSFiddle example: https://jsfiddle.net/s4wje415/

Ahmed Yusuf
  • 151
  • 3
  • 13

0 Answers0