Here is a Codepen for the problem I am trying to resolve (or simply understand): http://codepen.io/jhogue/pen/wtLiD
Basically, I have a set of columns that are floating. I want to use nth-of-type
to clear a column that starts a new row. In this case, every third .column
starting at the fourth. This is how I understand (3n+4)
to work.
I need a header in there as well, that is the first div
element. Even though I thought that nth-of-type
would apply to only the elements I apply it to – in this case, elements with the class .column
– it is clearly counting the first element in the container.
So, does nth-of-type
just not work this way? Is my understanding of how it works incorrect?
A clear picture of what nth-of-type
is supposed to do, vs. nth-child
: http://css-tricks.com/the-difference-between-nth-child-and-nth-of-type/