Selectors target elements. p selects all paragraphs, .card by class, and #header by ID. Combine: .nav a targets links inside .nav. Pseudo-classes like :hover and :focus style elements in specific interactive states.
CSS Selectors
* { box-sizing: border-box; } /* universal */
p { color: gray; } /* element */
#header { background: blue; } /* id */
.card { padding: 1rem; } /* class */
div p { margin: 0; } /* descendant */
div > p { margin: 0; } /* direct child */
h1, h2, h3 { font-family: serif; } /* group */
a:hover { text-decoration: none; } /* pseudo-class */
a::before { content: "→ "; } /* pseudo-element */
input[type="text"] { border: 1px solid; } /* attribute */