Makzan / I share what I learned

CSS rules priority

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:

Published on 2014-10-10. More articles like this:
- Web Technologies

Previous <- CSS is 20 years old
Next -> Example of selling benefits

📬 Subscribe to Makzan’s Weekly Dispatch

Want productive tips and web technologies links like this in your inbox each week? Sign up for weekly dispatch each week. No spam ever. Just useful content:

What to expect: If you wish to withdraw your consent and stop hearing from us, simply click the unsubscribe link at the bottom of every email we send or contact us at We value and respect your personal data and privacy. To view our privacy policy, please visit our website. By submitting this form, you agree that we may process your information in accordance with these terms.