|
|
|
|
|
by slowwriter
1124 days ago
|
|
I entirely agree that the explanation in the article is somewhat confusing, because we're selecting 3 items starting from #3 in a list, counting both from the top and the bottom. So which of those three options does the 3 stand for? The very first demo in the MDN doc for :nth-last-child helped me understand: https://developer.mozilla.org/en-US/docs/Web/CSS/:nth-last-c... – just change the "-n + 3" to "n + 3" to match the example in the article. In that case the selector starts at the third element from the bottom and ends at the top element, matching a total of 6 elements. |
|