Types of selector has the following priority order.
!important > inline style="" > ID > class > DOM Element
When two selectors are in the same types, the count determines the orders. Demo:
Types of selector has the following priority order.
!important > inline style="" > ID > class > DOM Element
When two selectors are in the same types, the count determines the orders. Demo: