This is not the first time I see someone run into this problem so I decided to write few words on this topic. So far I haven’t run into situation or a real need that I have to use :nth-child selector (although it seems to be more popular) instead of :nth-of-type, how often do you think “I want to select the second child of a parent if it just happens to be a paragraph.”. Of course, in the current version of your html you might can make your code to work, your java script or your css, but that can be untriggered bomb for anyone that will inherit your code and which is even worse that anyone can be you in the future.
It’s best to explain this with a practical example. Let’s say that we have a scoreboard with results from an athletic track race. Read More »