Lesson 2 of 8
Selectors
A selector tells CSS which HTML element to style. The most common are element selectors, class selectors, and ID selectors.
A class can be used on multiple elements. An ID should be unique to one element. Use a dot (.) for classes and a hash (#) for IDs.
CSS
/* Element selector */
p { color: blue; }
/* Class selector */
.highlight { background: yellow; }
/* ID selector */
#header { font-size: 24px; }