vadnica-logo
Editor My Blog My Services About the Project Telegram O meni O meni

CSS Colors

Colors in CSS can be specified in several ways: with predefined names (e.g., red), HEX codes (e.g., #ff0000), RGB, HSL values, or by adding transparency (RGBA, HSLA). These values are used for text color (color) and background color (background-color).

The background-color property sets the background color of an element. The background extends over the entire content of the element, including padding and borders, but does not extend over the margin. The color property sets the text color within the element content. Both properties allow choosing colors using color names, as well as RGB, HEX, HSL, RGBA, or HSLA values.

EXAMPLE
RESULT

Quick CSS Color Picker

Choosing the right colors is crucial for a good appearance when designing websites. Below, you can click on the color field to open a palette and select any shade. The tool will immediately display the HEX and RGB codes, which you can easily copy into your CSS file. This saves you time, as you do not need to guess values or use external programs.

RESULT
Format Example Description
Color Names
color namecolor: red;Predefined color names (140+ names, e.g. red, blue, green)
transparentbackground-color: transparent;Fully transparent color
currentColorborder-color: currentColor;Uses the current value of the element's color property
HEX (Hexadecimal)
#rrggbbcolor: #ff0000;Full HEX code – rr (red), gg (green), bb (blue)
#rgbcolor: #f00;Short HEX code (same as #rrggbb)
#rrggbbaacolor: #ff000080;HEX code with transparency – aa (alpha)
RGB / RGBA
rgb(r, g, b)color: rgb(255, 0, 0);Red (0–255), Green (0–255), Blue (0–255)
rgba(r, g, b, a)color: rgba(255, 0, 0, 0.5);RGB with transparency – a (0 = transparent, 1 = opaque)
HSL / HSLA
hsl(h, s%, l%)color: hsl(0, 100%, 50%);Hue (0–360°), Saturation (0–100%), Lightness (0–100%)
hsla(h, s%, l%, a)color: hsla(0, 100%, 50%, 0.5);HSL with transparency – a (0 = transparent, 1 = opaque)
Color Properties
colorcolor: #333;Sets the text color
background-colorbackground-color: #f0f0f0;Sets the background color of an element
border-colorborder-color: red;Sets the border color of an element
opacityopacity: 0.5;Sets the transparency of the entire element (0–1)