Difference between div~div and div:not(:first-of-type)?

Both are same in terms of matching elements. Let us see an example:

   
   
   

   
   

   
   

If you have CSS rules with both selectors matching the same elements, then your div: not(:first-of-type) will get precedence due to the: first-of-type pseudo-class.

Updated on: 2020-01-28T09:18:12+05:30

171 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements