aubsrey
September 1, 2018, 9:13pm
1
Question
What is specificity?
Answer
When we have two or more conflicting CSS declarations on the same element, the browser gives the declarations a score (the specificity ) to determine which declaration will be applied to the element. The declaration with the higher score will be applied to the element.
2 Likes
dodilei
September 16, 2019, 11:11pm
2
What will happen if two classes declare the same property but with different values on an element? Wich one has the higher specificity?
Hello @dodilei ! Welcome to the forum.
I answered a similar question a while back: Is it possible for two selectors targeting the same element to have the same specificity? If so, which styles “win” out?
Get Help CSS
Yes. It still will receive the style specified by the last selector in order from top to bottom that refers to the html element specified. The order in which the class names appear in the element tag itself will make no difference. They still refer to the same element which receives the style. The classes aren’t styled, they just identify the element.
If that doesn’t answer your question, please post again. Happy coding!
3 Likes
dodilei
September 17, 2019, 12:03am
4
Hello! I understood, thank you.
1 Like
can i change size of footer in “p” property also? it is proper step to do ?