Ok, so i went back to the css field... and don't understand what i get : All widgets are affected... just a bit more for the expected ones...
JS{{
var INDEX = [1,16,23,49,72]
var css = ''
for (var i = 0; i < INDEX.length; i++)
{css += ":nth-child(" + (INDEX[i]) + "){color:red ; font-size:180%;}"}
return css
}}
JS{{
var INDEX = [1,16,23,49,72]
var css = ''
for (var i = 0; i < INDEX.length; i++)
{css += ":nth-child(" + (INDEX[i]) + "){margin-left:12px}"}
return css
}}
Don't i need to put something before :nth-child ? I tried item, but that's not ok...
Don't i need to put something before :nth-child ? I tried item, but that's not ok...
Yes yo do otherwise the selector is too vague (targetting any element that's first child of its parent), but you need to use the browser inspector (F12) to see what classes a given to the element you're targetting, in this case this would do
.widget:nth-child
Sometimes less is more, that JS block doesn't help much here:
.widget:first-child,
.widget:nth-child(16),
.widget:nth-child(23),
.widget:nth-child(49),
.widget:nth-child(72) {
/* all styles at once) */
}