Given an ul
with a structure like this:
- ...
- ...
This cannot be done with plain CSS (in any way that I yet know of), however a plain-JavaScript solution is pretty simple:
var lis = document.querySelectorAll('li.product');
for (var i=0,len=lis.length;i
JS Fiddle demo.
jQuery could be used instead (as could, presumably, any other JavaScript library), but it's certainly not required.