Skip to content

Try our new Crash Courses!

Become a member using the button below to hide this banner and gain access to our new Crash Courses.

Text color – CSS

Demo

Summary

To change the color of an element’s text using CSS, use the color property:

selector {
  color: red;
}

Details

You can use RGB, hex, HSL, and keyword values for the color property.

Exercises

First, recreate the CSS code from the Demo section in your CSS file. Then try changing the value for the property.

References

color property on MDN

Back to: CSS Reference > CSS Properties