Languages
[Edit]
EN

CSS - available color formats and values

0 points
Created by:
Ela-Davey
663

In this article, we would like to show you the available color formats and values in CSS.

Quick solution:

FormatExample value for red colorExample CSS

Predefined color names
(Cross-browser)

red
RGB255, 0, 0
RGBA 255, 0, 0, 1
Hexadecimal#FF0000
Hexadecimal
(with transparency)
#FF0000FF
HSL0°, 100%, 50%
HSLA0°, 100%, 50%, 0
currentColor keywordcurrentColor

 

Practical example

Edit

In this section, we present the practical example of how to use colors from the table above.

All colors are set to the red color with no transparency for simplicity (except currentColor that inherits value).

Runnable example:

Alternative titles

  1. CSS - different color value
1
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join