Journal Day 2 Week 1
# Journal Day 2 Week 1
What is a Pseudo-Class and what are some of the most common ones you think you will use
What is Specificity and how might you use it to your benefit?
What problems do you think you could run into if you over-utilized the !important feature?
A pseudo-class is a modifier you put on classes when you want something to happen when the class is interacted with, whether through the mouse or another key. One common one I found that is used a lot is :hover, in which something will happen when you hover the mouse over the element.
Specificity is how CSS determines which line of code to run on a certain object. If multiple lines of code are affecting the same line, whichever one has a higher specificity will be the one run. Specificity has 3 different numbers(,,*), and it checks the leftmost 1st, and if they are the same, it goes to the left, repeating the same process. If they are all even, then it runs the line of code it read last.
One reason that overusing the !important rule is dangerous and bad is you can get reliant on it. If you keep using the !important feature, you won't properly learn about specifity. Another bad part about it is that it can mess up your code, and if you want to change one color on a bunch of different things, you would have to go through and change them one by one.
Afternoon Challenge Link: https://github.com/JordanWilker/Cool-Site