Why doesn’t nth-of-type/nth-child work on nested elements?

:nth-of-type() is similar to :nth-child() in that they must all be from the same parent. If you need those wrapper divs, use :nth-of-type() on those wrappers instead: div.post:nth-of-type(odd) .video-entry-summary { width:214px; height:210px; margin-left:0px; float:left; position:relative; overflow:hidden; border:1px solid black; background:#ccc; } If all the siblings are .post, use :nth-child() instead to prevent confusion with what … Read more