CSS rules consist of a selector (what to style) and a declaration block (how to style it). The browser resolves conflicting styles using the Cascade: specificity scores determine whether an element selector (1 pt), class selector (10 pts), or ID selector (100 pts) wins.
Entity state & role in architecture: !important Override
/* Element Selector (Score: 1) */
p {
color: #94a3b8;
line-height: 1.6;
}
/* Class Selector (Score: 10) - Recommended for components */
.feature-badge {
background-color: #0284c7;
color: #ffffff;
padding: 6px 12px;
border-radius: 9999px;
font-weight: 600;
display: inline-block;
}
/* Pseudo-class hover state */
.feature-badge:hover {
background-color: #0369a1;
}.feature-badgeTarget all elements with class='feature-badge' in HTML.
border-radius: 9999px;Pill shape: renders perfectly rounded capsule borders.
.feature-badge:hoverApplies alternate styles when user cursor hovers over element.