Avoid Headaches by Understanding CSS Specificity

Written by ae-cordova | Published 2020/03/01
Tech Story Tags: css | css3 | css-selectors | web-dev | css-fundamentals | frontend | web-development | html

TLDR Specificity is a tricky one of the concepts you have to understand in CSS. If there are two or more CSS rules that point to the same element, the browser gives more weight to the one with the most specific selector. The browser will apply the style of the rule using the latter. The one appearing latest in the style-sheet wins in case of conflicting rules. If you have a rule you want to apply, no matter what, there is a keyword to override everything: "You override everything"via the TL;DR App

no story

Published by HackerNoon on 2020/03/01