Services Work Learn About Contact
0/8
Lesson 3 of 8

Colors & Backgrounds

CSS supports colors by name (red, blue), hex (#ff0000), RGB (rgb(255,0,0)), and HSL. The color property sets text color, while background-color sets the background.

You can also set background images with background-image and control how they repeat or cover the element.

CSS
/* Text color */
h1 { color: #534AB7; }

/* Background color */
body { background-color: #f8f8fc; }

/* Background image */
.hero {
  background-image: url("bg.jpg");
  background-size: cover;
}
🧠

Quick Quiz

Answer correctly to unlock the next lesson.

Support the mission

This learning platform is 100% free: no ads, no tracking, no paywalls. If it helped you learn something useful, you can support future lessons or donate to Doctors Without Borders, which provides emergency medical care in crisis zones worldwide.

🎉

You completed CSS!

You finished all 8 lessons and quizzes. You now know the basics of CSS.