I’m learning about pseudo-class and I think I found a bug of :nth-of-type. I have 1 div has class 'container ’ and 6 div inside have class ‘item’. This is my code :
And when I run, everything is normal. The item 2 has ‘‘background-color : blue’’
But when I add an empty div element in front of item 1 . Like this :
Now when I run, item 1 has ‘‘background- color : blue’’. It’s different from the normal behavior of nth-of-type. It should be the item 2 has background blue. When I convert the empty div tag to a empty p tag . It works normally.
May it is a bug ?