CSS has several different variations for specifying color. They are HEX (long and shorthand), Color Keywords, RGB, RGBA, HSA, HSLA.
/* Hex - short */ color: #ddd; /* Hex - long */ color: #F04530; /* Color Keyword */ color: red; /* RGB */ color: rgb(255,255,255); /* RGBA */ color: rgba(200, 54, 54, 0.5); /* HSL */ color: hsl(166, 92%, 50%) /* HSLA */ color: hsla(128, 42%, 50%, 0.61)
Note: Some browsers don’t like RGBA, HSL and HSLA. Use with caution.
Want to become a better web developer?
Join over 25,000 other developer & designers who get awesome links to the best news and articles each week delivered directly to their inbox.