Basic Style RulesElement SelectorsDeclarations and KeywordsGroupingGrouping SelectorsThe universal selectorGrouping DeclarationsGrouping EverythingClass and ID SelectorsClass SelectorsMultiple ClassesID SelectorsDeciding Between Class and IDAttribute SelectorsSimple Attribute SelectorsSelection Based on Exact Attribute ValueSelection Based on Partial Attribute ValuesMatching one word in a space-separated listMatching a substring within an attribute valueMatching a substring at the beginning of an attribute valueMatching a substring at the end of an attribute valueA Particular Attribute Selection TypeUsing Document StructureUnderstanding the Parent-Child RelationshipDescendant SelectorsSelecting ChildrenSelecting Adjacent Sibling ElementsSelecting Following SiblingsPseudo-Class SelectorsCombining Pseudo-ClassesStructural Pseudo-ClassesSelecting the root elementSelecting empty elementsSelecting unique childrenSelecting first and last childrenSelecting first and last of a typeSelecting every nth childSelecting every nth of a typeDynamic Pseudo-ClassesHyperlink pseudo-classesUser action pseudo-classesReal-world issues with dynamic stylingUI State Pseudo-ClassesEnabled and disabled UI elementsCheck statesThe :target Pseudo-ClassThe :lang Pseudo-ClassThe Negation Pseudo-ClassPseudo-Element SelectorsStyling the First LetterStyling the First LineRestrictions on ::first-letter and ::first-lineStyling (Or Creating) Content Before and After ElementsSummary