Home
Basics
Introduction Adding styles Selectors Headings and Text Lists Links Tables Colors Background Box Model Fonts Icons Display Position Overflow Align Images Tool tips FlexAdvanced
Shadows Rounded Corners Units Specificity Responsive design Media Queries Grid Animations Psuedo elements CSS variables and functions SASS and SCSSMiscellaneous
CSS Templates CSS Interview QnASpecificity in CSS
Specificity in CSS is used to determine which css rule wins when we have multiple css rules applied to same element. e.g. If we have span element with class "tip" and we have 2 css rules that target this span element, then an algorithm is used to determine which rule wins.
span{
color:red;
}
.tip{
color:blue;
}
In above example, .tip(class) rule will win as it has more specificity than span(element) rule.Web development and Automation testing
solutions delivered!!