1.1 Welcome to the Course
Hello and welcome to this Envato Tuts+ course. I’m Adi Purdila, and in this short course you’ll learn about CSS specificity.
If you’ve ever written CSS code, you’ll have been in the following situation: you’re writing some CSS and for some reason, one style doesn’t apply correctly or is overridden by another style, and you just can’t figure out why it’s happening. This can lead to a lot of wasted time and hair-pulling.
However, it can be avoided or fixed quickly if you understand how CSS specificity works. We’ll start by learning what CSS specificity is all about and how browsers use it to determine which styles to apply to elements. In lessons 2 and 3, we’ll learn about its hierarchy and how to rank or calculate it ourselves. Finally, in lesson 4, we’ll discuss the
!important rule, plus the universal selectors and their role in the calculation of specificity.
So, if you’re ready, let’s get started with understanding what CSS specificity is.