CSS rules priority

Types of selector has the following priority order.

1!important > inline style="" > ID > class > DOM Element

When two selectors are in the same types, the count determines the orders.

Demo:

See the Pen CSS Cascading Priority by Thomas Seng Hin Mak (@makzan) on CodePen.

–mz
.
overlaied image when clicked on thumbnail

Makzan | Web design scrapbook | Table of Content