CSS Selectors
Target specific elements with element, class, and ID selectors.
Step 1 of 5
Element selectors
The simplest selector is just the tag name: p, h1, div. It targets ALL elements of that type on the page. This is useful for setting baseline styles — for example, most websites set a default font and color on the body or p selector so all text looks consistent without styling each paragraph individually.
Think of it this way: It's like a school uniform — one rule that applies to everyone. When a website sets p { font-size: 16px; }, every paragraph on the site gets the same readable size, just like every student wears the same uniform.
Learn more on MDN
CSSREAD ONLY
CSS PREVIEW
/* Targets every paragraph */
p {
color: green;
}