Skip to main content
Brave Programmer Logo

BraveProgrammer

BraveProgrammer

HomeProjectsBlogsCoursesLessonsAbout

Site footer

BraveProgrammer

Free coding courses, practical tutorials, and real projects from BraveProgrammer. Learn web development with React, Next.js, and TypeScript.

Navigation

  • Home
  • Projects
  • Blogs
  • Courses

Resources

  • About
  • Lessons
  • Teach on BraveProgrammer

© 2026 BraveProgrammer. All rights reserved.

Basic Selectors | CSS Course lesson | BraveProgrammer
  1. Courses
  2. /
  3. CSS Course

Lesson 3 of 50

·css

Basic Selectors

10 mins

Course progress6%

What you'll learn

Keep these ideas in mind as you work through the lesson.

3 points
  • Selectors are the bridge between HTML and CSS.
  • Class selectors (`.myClass`) are the most common way to style groups.
  • IDs (`#myId`) are unique and have higher specificity.

Selectors let you pick elements.

SelectorMeaning
*All elements
pAll <p> elements
.classElements with class="class"
#idElement with id="id"
element, element2Grouped selectors

Example

h1, h2 { color:#333; }

.button { background:#0066cc; color:#fff; }
Make it stickPractice what you've learned1 quiz · 6 practical tests · Optional activities from CSS CourseBrowse activities
Previous lessonAdding CSS to a PageContinue to lesson 4The Cascade & SpecificityBack to CSS Course curriculum