An ID selector matches an element by its ID attribute, using a hash-prefixed name such as #page-title. In the cascade, one ID outweighs any number of class selectors and outranks tag selectors. section 1.1.3
Listing 1.6 Selectors with increasing specificities
html body header h1 { #1
color: blue;
}
body header.page-header h1 { #2
color: orange;
}
.page-header .title { #3
color: green;
}
#page-title { #4
color: red;
}
Compare selectors from least to greatest specificity: four tag names, one class with tags, two classes, then the single ID selector #page-title. section 1.1.3
Resolving a highlighted navigation link
A broad #main-nav a rule can keep links teal while #main-nav .featured overrides only the featured link with an orange background. This targeted combination is preferable to adding !important, which forces the declaration outside ordinary specificity decisions. section 1.1.3


