Quote:
Originally Posted by devnull69
YES, you can do it for "class"
NO, it won't work for "id"
|
Really, so if I was to change the ID to a class and add this code
Code:
$(document).ready(function() {
$(".article-inspir:nth-child(2n)").append("<div style='clear:both;'></div>");
});
It would would ? Doesn't that rubbish what was said above ?
Quote:
Originally Posted by rnd me
Code:
#article-inspir:nth-child(2n)
hits both
Code:
<article id="article-inspir" class="drop-shadow curved curved-hz-1">
i will say however, that you shouldn't actually need to use scripts for this.
simply use CSS to add clear:both to the same selector, or use :after content if you really need to inject a styled block.
in general with these sort of problems, just try out different permutations in the firebug or dev tools console until you hit the tags you want.
|
There is nothing in CSS that will work with this. Only nth term which isn't backwards compatible so that is why I'm using Jquery.