css-cascade-4 Flashcards
What is specificity?
means by which browsers decide which CSS property values are the most relevant to an element and, therefore, will be applied.
How is specificity calculated?
Specificity is a weight that is applied to a given CSS declaration, determined by the number of each selector type in the matching selector.
Why might CSS include this feature?
to style your elements, in the correct way. It’s easier to quickly change a style when you know exactly which selector styles that specific element.
What is the order of selector strengths for CSS specificity (commonly referred to as the Specificity Hierarchy)?
-inline styles
-id attrib
classes,pseudo-class, other attrib
-elements,pseudo-elements
-universal selector
What is the CSS Cascade?
an algorithm that defines how to combine property values originating from different sources.