I’m having a little bit of trouble using CSS’s :nth-child(odd) selector. It seems to apply the CSS rules to every image when I select it based on a div class.
For example:
.class img:nth-child(odd) { margin-right:10px; }
and it’s resulting in all of them being selected. Tried using
img.class:nth-child(odd) { margin-right:10px; }
and get the same results. http://jsfiddle.net/7mUDG/
Does it work for only table elements or something? Am I selecting it incorrectly?
Many thanks, SO
Your :nth-child selector is one level too deep. look at http://jsfiddle.net/demchak_alex/7mUDG/2/