Jitendra Vyas
Jitendra Vyas

Reputation: 152677

How to get css sprite class in Compass in this manner?

.offbeat {background-position: x y }
.active .offbeat {background-position: x y }

Becuase in active condition i want to chage the position of image.

active mean selected in my case

Upvotes: 0

Views: 163

Answers (1)

Dipak
Dipak

Reputation: 12190

For Styling simply add the active class -

<div class="offbeat active">Some Content</div>

If you are using jQuery -

$('.offbeat').click(function(){
  $(this).toggleClass('active')
});

And change the background position of the image -

.active{
  background-position: x y; /*New Position*/
}

Do not inherit active class with offbeat

Try adding -

.offbeat:active{...............}

Don't know about compass but this is how CSS works!

Upvotes: 1

Related Questions