Answer the question
In order to leave comments, you need to log in
Is it possible to use the element ID as a variable?
You need to dynamically assign a background image depending on the ID. Something like this:
@each .class-elementa {
background: url(/images/#{$id-elementa}.jpg)
}
Answer the question
In order to leave comments, you need to log in
@each $name in 'save' 'cancel' 'help' {
.icon-#{$name} {
background-image: url('/images/#{$name}.png');
}
}
.icon-save {
background-image: url("/images/save.png");
}
.icon-cancel {
background-image: url("/images/cancel.png");
}
.icon-help {
background-image: url("/images/help.png");
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question