About Red
Red (red) is a medium, vivid red with the hex code #ff0000, or rgb(255, 0, 0). In HSL it sits at a hue of 0°, 100% saturation and 50% lightness. It is one of the 148 named colors every browser understands, so you can write color: red; instead of the hex value.
Using Red for text and backgrounds
| Pairing | Contrast ratio | WCAG |
|---|---|---|
| Red text on white | 4.00 : 1 | AA large text only |
| Red text on black | 5.25 : 1 | AA |
On a red background, use black text (5.25 : 1). WCAG asks for at least 4.5 : 1 for body text and 3 : 1 for large text. Check other pairs with the Contrast Checker.
CSS
.element {
color: red; /* or #ff0000 */
background-color: #ff0000;
border: 1px solid rgb(255 0 0 / 50%);
}
Similar named colors
Orange Red (#ff4500), Crimson (#dc143c), Fire Brick (#b22222), Brown (#a52a2a), Dark Red (#8b0000), Chocolate (#d2691e).