← Back to Glossary

color

Colors & Backgrounds

Sets the foreground color of an element's text content. Can accept color names, HEX, RGB, or HSL values.

Common Value Formats

  • color: red; Named color
  • color: #ff0000; HEX color
  • color: rgb(255, 0, 0); RGB color
  • color: hsl(0, 100%, 50%); HSL color
  • color: transparent; Makes text invisible
interactive-example.html
Live Preview