<?xml version="1.0" encoding="utf-8"?>

CSS color property for setting text color

CSS color property for setting text color Bad Practice
CSS color property for setting text color Best Practice

The color property sets the text color. It can take different types of values. The most commonly used are:

  • Color names — for example, red
  • HEX values — for example, #800080
  • RGB values — for example, rgb(128,0,128)

To define the default text color for a page, add the declaration for the body selector. For example:

body {

color: grey;

}

Improve your UX & Product skills with interactive courses that actually work